required
Executes the given block within a transaction scope.
If a transaction is currently active (autoCommit = false), the block will be executed within the existing transaction. Otherwise, a new transaction is started, and it will be committed upon successful completion, or rolled back if an exception occurs.
Inside the block, manual transaction operations such as commit, rollback, and autoCommit modifications are not accessible as the receiver is restricted to OctaviusSessionOperations. A return out of the block does not compile either - use return@required, since an early exit would otherwise commit whatever the block had already done, which is the same decision the restricted receiver is there to keep out of the block.
Whatever of isolation, readOnly, statementTimeout and transactionTimeout is asked for goes out as one statement after the BEGIN, in a single round trip; asking for none of them sends nothing at all. All four end with the transaction, which is what separates them from OctaviusSessionOperations.transactionIsolationLevel and OctaviusSessionOperations.readOnly - those are session-wide, and are not what this sets.
A transaction already running keeps the terms it began at: none of the four applies, and a warning names them.
Return
The result of the block.
Parameters
The isolation level for this transaction, or null for the session's.
Whether this transaction refuses writes.
Aborts any single statement in this transaction that runs longer than this.
Aborts this transaction once it has been open longer than this.
The block of code to execute.