Anvil Transactions add a transaction ID

I would say that setting up a transaction on a form for multiple table posting is not a recommended way in itself.

During the time between the start and the end of the transaction, the rows / tables / database (I don’t know the granularity) involved in the transaction are blocked and can’t be written to. Setting up the transaction on a form means you will have a bunch of roundtrips between the beginning and the end of the transaction, which means the duration of the transaction will be hundreds of times longer than it needs to be.

It can be OK if you can swear that your site is very low traffic, but “setting up a transaction on a form” it is not “the recommended way”.

The recommended way is to have the form collect all the data required for the transaction, pack it in a dict, pass that dict to a server function, then execute the transaction on the server.

This way the time required for the transaction will be much shorter.

3 Likes