ThreadLocalTransactionManager

TransactionManager implementation registered to the provided database value db.

setupTxConnection can be provided to override the default configuration of transaction settings when a connection is retrieved from the database.

Constructors

Link copied to clipboard
constructor(db: Database, setupTxConnection: (ExposedConnection<*>, TransactionInterface) -> Unit? = null)

Properties

Link copied to clipboard
@set:TestOnly
open override var defaultIsolationLevel: Int

The default transaction isolation level. Unless specified, the database-specific level will be used.

Link copied to clipboard
open override var defaultMaxAttempts: Int

The default maximum amount of attempts that will be made to perform a transaction.

Link copied to clipboard
open override var defaultMaxRepetitionDelay: Long
Link copied to clipboard

The default maximum number of milliseconds to wait before retrying a transaction if an exception is thrown.

Link copied to clipboard
open override var defaultMinRepetitionDelay: Long
Link copied to clipboard

The default minimum number of milliseconds to wait before retrying a transaction if an exception is thrown.

Link copied to clipboard
open override var defaultReadOnly: Boolean

Whether transactions should be performed in read-only mode. Unless specified, the database default will be used.

Link copied to clipboard
open override var defaultRepetitionAttempts: Int
Link copied to clipboard

A thread local variable storing the current transaction.

Functions

Link copied to clipboard
open override fun bindTransactionToThread(transaction: Transaction?)

Sets the current thread's copy of the manager's thread-local variable to the specified transaction.

Link copied to clipboard
open override fun currentOrNull(): Transaction?

Returns the current Transaction, or null if none exists.

Link copied to clipboard
open override fun newTransaction(isolation: Int, readOnly: Boolean, outerTransaction: Transaction?): Transaction

Returns a Transaction instance.

Link copied to clipboard
open override fun toString(): String