OctaviusJdbcTransactionManager
A transaction manager for a DataSource that runs each transaction through an OctaviusSession, so a failure of the database or the connection leaves it as the driver's own exception.
The session is opened when the transaction begins and closed when it ends, and every OctaviusTemplate.execute inside the transaction runs through it.
On a connection that is already gone a commit raises and a rollback stays quiet; so do releasing a Propagation.NESTED savepoint and rolling back to it.
A commit that raises is rolled back after, whatever rollbackOnCommitFailure says - that setting covers a TransactionException only - so synchronizations hear STATUS_ROLLED_BACK, even where the connection went while the COMMIT waited and the server may have committed.
@Transactional(timeout = ...) is enforced on the server, as timeoutScope names.
OctaviusSpringAutoConfiguration registers it when the application declares no transaction manager of its own.
Properties
The data source whose connections the transactions run on.
What a transaction's timeout is enforced on, TransactionTimeoutScope.STATEMENT unless set. A transaction without a timeout - none on the annotation, no defaultTimeout here - sends nothing.
Functions
Takes a connection, opens the session over it, begins the transaction, and binds the session to the thread. A connection the data source would not hand over comes out as the driver's exception, as from OctaviusTemplate, not as Spring's CannotCreateTransactionException.
Picks up the session of a transaction this manager is running; one OctaviusTemplate bound is not one.
Rolls back, and stays quiet for a transaction whose connection is already gone.
Sends the transaction's timeout, where it has one, as SET LOCAL of the setting timeoutScope names, so nothing follows the connection back to the pool. Called only for a transaction this manager begins, never for one a method joins or a savepoint. A statement sent here also sends the transaction's BEGIN, which the driver otherwise holds back until the method's first statement.