execute

open override fun <T> execute(propagation: TransactionPropagation, isolation: IsolationLevel = IsolationLevel.DEFAULT, readOnly: Boolean = false, statementTimeout: Duration? = null, transactionTimeout: Duration? = null, block: (TransactionStatus) -> T): T

Executes a block of code within a transaction context.

Parameters

propagation

The transaction propagation behavior (e.g., REQUIRED, REQUIRES_NEW).

isolation

The isolation level to use. IsolationLevel.DEFAULT leaves the current state unchanged.

readOnly

Hint to the database for read-only optimization.

statementTimeout

Optional timeout for single statement. Working on in Core.

transactionTimeout

Optional timeout for the entire transaction (requires PG 17+ in Core).

block

The logic to execute within the transaction.