English | 简体中文

api-docs / org.ktorm.database / SpringManagedTransactionManager

SpringManagedTransactionManager

class SpringManagedTransactionManager : TransactionManager (source code)

TransactionManager implementation that delegates all transactions to the Spring framework.

This class enables the Spring support, and it’s used by Database instances created
by Database.connectWithSpringSupport function. Once the Spring support enabled, the
transaction management will be delegated to the Spring framework, so the Database.useTransaction
function is not available anymore, applications should use Spring’s Transactional annotation instead.

Constructors

NameSummary

<init>

SpringManagedTransactionManager(dataSource: DataSource)

TransactionManager implementation that delegates all transactions to the Spring framework.

Properties

NameSummary

currentTransaction

val currentTransaction: Transaction?

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

dataSource

val dataSource: DataSource

the data source used to obtained connections, typically comes from Spring’s application context.

defaultIsolation

val defaultIsolation: TransactionIsolation?

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

Functions

NameSummary

newConnection

fun newConnection(): Connection

Create a native JDBC connection to the database.

newTransaction

fun newTransaction(isolation: TransactionIsolation?): Nothing

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.