> In the example on the docs page it looks like the logic is happening in the app code
Not quite. The code in the docs you linked to handle what happens when a transaction does not complete server-side -- typically, you want to re-try the entire transaction a few times in case transient locks have been released or preconditions met. It does not suggest that the transaction is being controlled/orchestrated by the client.
> Are you saying that transactions are serialized as a series of pure updates and sent to the server as such?
Yes, generally. Check out examples of Postgres transactions -- they are plain-text "queries" that are executed with all-or-nothing semantics.
> (to me) transaction implies interaction with the data in app code.
Transactions, generally, are groups of statements/queries that are either all applied or none at all. They do not imply interaction with the data in app code, unless the app code itself is executed as part of the transaction itself (e.g., UDFs or stored procedures). They are like mini-programs that are shipped to the DB to be executed in a concurrency controlled and undo-able environment.
Not quite. The code in the docs you linked to handle what happens when a transaction does not complete server-side -- typically, you want to re-try the entire transaction a few times in case transient locks have been released or preconditions met. It does not suggest that the transaction is being controlled/orchestrated by the client.
> Are you saying that transactions are serialized as a series of pure updates and sent to the server as such?
Yes, generally. Check out examples of Postgres transactions -- they are plain-text "queries" that are executed with all-or-nothing semantics.
> (to me) transaction implies interaction with the data in app code.
Transactions, generally, are groups of statements/queries that are either all applied or none at all. They do not imply interaction with the data in app code, unless the app code itself is executed as part of the transaction itself (e.g., UDFs or stored procedures). They are like mini-programs that are shipped to the DB to be executed in a concurrency controlled and undo-able environment.