restoreAutoCommit

internal fun restoreAutoCommit(failure: Throwable?)

Puts auto-commit back once a scope is over, however it ended.

A failure here is only rethrown when the scope was already failing, and then as a suppressed exception on failure rather than in its place. Out of a scope that committed it is logged and goes no further. The commit left nothing open, so switching back sends nothing, and what can still fail is only the check that the connection is there - which means it went away after the commit, and that is already on the record: checkClosed raises NetworkException the next time anything touches this session, logged or not. Raising it here would only report a failed transaction for one whose work is in the database, and invite a retry that writes it twice.