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
Name | Summary |
---|---|
abstract val currentTransaction: Transaction? The opened transaction of the current thread, null if there is no transaction opened. | |
abstract val defaultIsolation: TransactionIsolation? The default transaction isolation, null for the default isolation level of the underlying datastore. |
Functions
Name | Summary |
---|---|
abstract fun newConnection(): Connection Create a native JDBC connection to the database. | |
abstract fun newTransaction( Open a new transaction for the current thread using the specific isolation if there is no transaction opened. |
Extension Functions
Name | Summary |
---|---|
infix fun <T : Any> T.eq( Equal operator, translated to | |
infix fun <T : Any> T.neq( Not-equal operator, translated to | |
infix fun <T : Any> T.notEq( Not-equal operator, translated to |
Inheritors
Name | Summary |
---|---|
class JdbcTransactionManager : TransactionManager TransactionManager implementation based on JDBC. | |
class SpringManagedTransactionManager : TransactionManager TransactionManager implementation that delegates all transactions to the Spring framework. |