prepareTransactionalSession
protected open fun prepareTransactionalSession(session: OctaviusSession, definition: TransactionDefinition)
Sends the transaction's timeout, where it has one, as the setting timeoutScope names.
SET LOCAL, so it ends with the transaction and nothing follows the connection back into the pool. Only a transaction this manager begins gets one - Spring applies a timeout to no other, so a method that joins a running transaction or takes a savepoint keeps the terms already in force.
Being a statement, it is also what sends the transaction's BEGIN, which the driver otherwise holds back until the first statement of the method; the two go out together. A transaction without a timeout sends nothing here, and keeps waiting.