# Package-level declarations

## Types

JdbcTransactionInterface
Link copied to clipboard
interface JdbcTransactionInterface : TransactionInterface

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

JdbcTransactionManager
Link copied to clipboard
interface JdbcTransactionManager : TransactionManagerApi

Represents the JDBC transaction manager interface, responsible for creating and managing JDBC transactions.

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

JdbcTransactionManager implementation registered to the provided database value db.

## Properties

transactionManager
Link copied to clipboard
val Database.transactionManager: JdbcTransactionManager

The JdbcTransactionManager instance that is associated with this Database.

## Functions

currentOrNull
Link copied to clipboard
fun JdbcTransactionManager.currentOrNull(): JdbcTransaction?

Returns the current JDBC transaction from the thread-local stack for this manager's database, or null if none exists.

inTopLevelSuspendTransaction
Link copied to clipboard
suspend fun <T> inTopLevelSuspendTransaction(db: Database? = null, transactionIsolation: Int? = db?.transactionManager?.defaultIsolationLevel, readOnly: Boolean? = db?.transactionManager?.defaultReadOnly, outerTransaction: JdbcTransaction? = null, statement: suspend JdbcTransaction.() -> T): T

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

inTopLevelTransaction
Link copied to clipboard
fun <T> inTopLevelTransaction(db: Database? = null, transactionIsolation: Int? = db?.transactionManager?.defaultIsolationLevel, readOnly: Boolean? = db?.transactionManager?.defaultReadOnly, outerTransaction: JdbcTransaction? = null, statement: JdbcTransaction.() -> 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.

suspendTransaction
Link copied to clipboard
suspend fun <T> suspendTransaction(db: Database? = null, transactionIsolation: Int? = db?.transactionManager?.defaultIsolationLevel, readOnly: Boolean? = db?.transactionManager?.defaultReadOnly, statement: suspend JdbcTransaction.() -> T): T

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

transaction
Link copied to clipboard
fun <T> transaction(db: Database? = null, transactionIsolation: Int? = db?.transactionManager?.defaultIsolationLevel, readOnly: Boolean? = db?.transactionManager?.defaultReadOnly, statement: JdbcTransaction.() -> 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.