DefaultJdbcTransactionProvider
Default implementation of JdbcTransactionProvider using ThreadLocal to manage transactions. This implementation does not depend on any external transaction managers (like Spring).
It supports:
Nested transactions via Savepoints.
Propagation (REQUIRED, REQUIRES_NEW).
Automatic restoration of connection state (isolation level, read-only) after transaction completion.
Transaction timeouts via PostgreSQL 'statement_timeout'.
Functions
Applies the current transaction timeout to the given statement.
Executes a block of code within a transaction context.
Obtains a connection for the current execution context. If a transaction is active, returns the connection bound to that transaction. Otherwise, returns a new connection from the dataSource.
Releases the given connection. If the connection is part of an active transaction, it is NOT closed. Otherwise, it is returned to the pool (closed).