applySettings

internal fun applySettings(isolation: TransactionIsolationLevel?, readOnly: Boolean, statementTimeout: Duration?, transactionTimeout: Duration?)

Hands the terms this transaction was opened with to its BEGIN, as one statement.

SET TRANSACTION for the isolation level and the read-only flag, SET LOCAL for the timeouts: both end with the transaction, so nothing here has to be undone before the connection goes back to a pool. The first of them has to precede the first query of the transaction, and nothing precedes it more closely than a message right behind the BEGIN - a script, sent with the BEGIN and the first statement alike, with nothing to bind.

Sent now only where the server already has a transaction running that no BEGIN of the driver's opened.