JdbcTransactionManager

TransactionManager implementation based on JDBC.

This class is capable of working in any environment with any JDBC driver. It accepts a connector function used to obtain SQL connections. Applications should return a native JDBC connection in the callback function, no matter it's newly established by DriverManager directly, or obtained from a connection pool such as DataSource.

Database instances created by Database.connect functions use this implementation by default.

Constructors

Link copied to clipboard
constructor(connector: () -> Connection)

Properties

Link copied to clipboard

the callback function used to obtain SQL connections.

Link copied to clipboard
open override val currentTransaction: Transaction?

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

Link copied to clipboard
open override val defaultIsolation: TransactionIsolation? = null

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

Functions

Link copied to clipboard
open override fun newConnection(): Connection

Create a native JDBC connection to the database.

Link copied to clipboard
open override fun newTransaction(isolation: TransactionIsolation?): Transaction

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