English | 简体中文

api-docs / org.ktorm.database / TransactionManager

TransactionManager

interface TransactionManager (source code)

Transaction manager abstraction used to manage database connections and transactions.

Applications can use this interface directly, but it is not primary meant as API:
Typically, transactions are used by calling the Database.useTransaction function or
Spring’s Transactional annotation if the Spring support is enabled.

Properties

NameSummary

currentTransaction

abstract val currentTransaction: Transaction?

The opened transaction of the current thread, null if there is no transaction opened.

defaultIsolation

abstract val defaultIsolation: TransactionIsolation?

The default transaction isolation, null for the default isolation level of the underlying datastore.

Functions

NameSummary

newConnection

abstract fun newConnection(): Connection

Create a native JDBC connection to the database.

newTransaction

abstract fun newTransaction(
    isolation: TransactionIsolation? = defaultIsolation
): Transaction

Open a new transaction for the current thread using the specific isolation if there is no transaction opened.

Extension Functions

NameSummary

eq

infix fun <T : Any> T.eq(
    expr: ColumnDeclaring<T>
): BinaryExpression<Boolean>

Equal operator, translated to = in SQL.

neq

infix fun <T : Any> T.neq(
    expr: ColumnDeclaring<T>
): BinaryExpression<Boolean>

Not-equal operator, translated to <> in SQL.

notEq

infix fun <T : Any> T.notEq(
    expr: ColumnDeclaring<T>
): BinaryExpression<Boolean>

Not-equal operator, translated to <> in SQL.

Inheritors

NameSummary

JdbcTransactionManager

class JdbcTransactionManager : TransactionManager

TransactionManager implementation based on JDBC.

SpringManagedTransactionManager

class SpringManagedTransactionManager : TransactionManager

TransactionManager implementation that delegates all transactions to the Spring framework.