# Package-level declarations

## Types

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

TransactionManager implementation registered to the provided database value db.

TransactionInterface
Link copied to clipboard
interface TransactionInterface

Represents a unit block of work that is performed on a database.

TransactionManager
Link copied to clipboard
interface TransactionManager

Represents the manager registered to a database, which is responsible for creating new transactions and storing data related to the database and its transactions.

TransactionStore
Link copied to clipboard
class TransactionStore<T : Any>(val init: Transaction.() -> T? = null) : ReadWriteProperty<Any?, T?>

Class responsible for implementing property delegates of read-write properties in the current transaction's `UserDataHolder`.

## Properties

transactionManager
Link copied to clipboard
val Database?.transactionManager: TransactionManager

The TransactionManager instance that is associated with this Database.

## Functions

inTopLevelTransaction
Link copied to clipboard
fun <T> inTopLevelTransaction(transactionIsolation: Int, readOnly: Boolean = false, db: Database? = null, outerTransaction: Transaction? = null, statement: Transaction.() -> T): T

Creates a transaction with the specified transactionIsolation and readOnly settings, then calls the statement block with this transaction as its receiver and returns the result.

nullableTransactionScope
Link copied to clipboard
fun <T : Any> nullableTransactionScope(): TransactionStore<T>

Returns the result of reading/writing transaction data stored within the scope of the current transaction, or `null` if no data is found.

transaction
Link copied to clipboard
fun <T> transaction(db: Database? = null, statement: Transaction.() -> T): T

Creates a transaction then calls the statement block with this transaction as its receiver and returns the result.

fun <T> transaction(transactionIsolation: Int, readOnly: Boolean = false, db: Database? = null, statement: Transaction.() -> T): T

Creates a transaction with the specified transactionIsolation and readOnly settings, then calls the statement block with this transaction as its receiver and returns the result.

transactionScope
Link copied to clipboard
fun <T : Any> transactionScope(init: Transaction.() -> T): ReadWriteProperty<Any?, T>

Returns the result of reading/writing transaction data stored within the scope of the current transaction.