TransactionTimeoutScope

What a Spring transaction timeout - @Transactional(timeout = …), a TransactionTemplate's, or spring.transaction.default-timeout - is enforced on.

Each scope is one PostgreSQL setting, and promises what that setting does. PostgreSQL has a timeout for each statement and one for the whole transaction, and none for both: bounding the whole transaction is transaction_timeout, and when that runs out the server ends the session rather than the transaction, so the connection goes with it. Neither is what JdbcTemplate does with the same timeout, which is to give each statement what is left of it. OctaviusJdbcTransactionManager.timeoutScope is where the choice is made.

Entries

Link copied to clipboard

Each statement of the transaction, through statement_timeout: one that runs longer is cancelled, and it comes back as ExecutionAbortedException on a connection that stays.

Link copied to clipboard

The transaction as a whole, through transaction_timeout, the time between statements included: at the deadline the server ends the session - running statement or none - and whatever touches it next gets SessionTerminatedException(TRANSACTION_TIMEOUT). It holds locks to the timeout even while the application is busy elsewhere, and it costs a connection each time it fires.

Properties

Link copied to clipboard

Returns a representation of an immutable list of all enum entries, in the order they're declared.

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Link copied to clipboard

Returns an array containing the constants of this enum type, in the order they're declared.