docs/api/exposed-jdbc/org.jetbrains.exposed.v1.jdbc/-jdbc-transaction/index.html
open class JdbcTransaction(transactionImpl: JdbcTransactionInterface) : Transaction, JdbcTransactionInterface
Class representing a unit block of work that is performed on a database using a JDBC driver.
MembersMembers & Extensions
Link copied to clipboard
constructor(transactionImpl: JdbcTransactionInterface)
Link copied to clipboard
object Companion
Link copied to clipboard
open override val connection: ExposedConnection<*>
The database connection used by the transaction.
Link copied to clipboard
var currentStatement: JdbcPreparedStatementApi?
The currently executing statement.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val defaultLogger: CompositeSqlLogger
A CompositeSqlLogger containing any SqlLogger instances that are implicitly added to a new transaction.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
var maxAttempts: Int
The maximum amount of attempts that will be made to perform this transaction block.
Link copied to clipboard
var maxRetryDelay: Long
The maximum number of milliseconds to wait before retrying this transaction if an SQLException happens.
Link copied to clipboard
var minRetryDelay: Long
The minimum number of milliseconds to wait before retrying this transaction if an SQLException happens.
Link copied to clipboard
open override val outerTransaction: JdbcTransaction?
Link copied to clipboard
var queryTimeout: Int?
Link copied to clipboard
open override val readOnly: Boolean
Link copied to clipboard
var statementCount: Int
Link copied to clipboard
val statements: StringBuilder
Link copied to clipboard
val statementStats: HashMap<String, Pair<Int, Long>>
Link copied to clipboard
val transactionId: String
Link copied to clipboard
open override val transactionIsolation: Int
The transaction isolation level of the transaction, which may differ from the set database level.
Link copied to clipboard
open override val transactionManager: JdbcTransactionManager
Link copied to clipboard
var warnLongQueriesDuration: Long?
Link copied to clipboard
override fun addLogger(vararg logger: SqlLogger): CompositeSqlLogger
Link copied to clipboard
open override fun close()
Closes the transaction and releases any savepoints.
Link copied to clipboard
fun closeExecutedStatements()
Closes all previously executed statements and resets or releases any used database and/or driver resources.
Link copied to clipboard
open override fun commit()
Saves all changes since the last commit or rollback operation.
Link copied to clipboard
fun <T> exec(stmt: BlockingExecutable<T, *>): T?
Executes the provided Statement object and returns the generated value.
fun <T, R> exec(stmt: BlockingExecutable<T, *>, body: Statement<T>.(T) -> R): R?
Executes the provided Statement object, retrieves the generated value, then calls the specified function body with this generated value as its argument and returns its result.
fun exec(stmt: String, args: Iterable<Pair<IColumnType<*>, Any?>> = emptyList(), explicitStatementType: StatementType? = null): Unit?
fun <T : Any> exec(stmt: String, args: Iterable<Pair<IColumnType<*>, Any?>> = emptyList(), explicitStatementType: StatementType? = null, transform: (ResultSet) -> T?): T?
Executes the provided statement exactly, using the supplied args to set values to question mark placeholders (if applicable).
Link copied to clipboard
fun execInBatch(stmts: List<String>)
Provided statements will be executed in a batch. Select statements are not supported as it's impossible to return multiple results.
Link copied to clipboard
fun <R> execQuery(query: BlockingExecutable<ResultApi, *>, body: Statement<ResultApi>.(ResultSet) -> R): R?
Executes the provided query object, retrieves the generated ResultSet, then calls the specified function body with this generated value as its argument and returns its result.
Link copied to clipboard
fun JdbcTransaction.explain(analyze: Boolean = false, options: String? = null, body: StatementBuilder.() -> Statement<*>): ExplainBlockingExecutable
Creates an ExplainQuery using the EXPLAIN keyword, which obtains information about a statement execution plan.
Link copied to clipboard
fun fullIdentity(column: Column<*>): String
Link copied to clipboard
fun <T : Any> getOrCreate(key: Key<T>, init: () -> T): T
Link copied to clipboard
fun <T : Any> getUserData(key: Key<T>): T?
Link copied to clipboard
fun identity(column: Column<*>): String
fun identity(table: Table): String
Link copied to clipboard
fun <T : Any> putUserData(key: Key<T>, value: T)
Link copied to clipboard
fun registerInterceptor(interceptor: StatementInterceptor): Boolean
Adds the specified StatementInterceptor to act on this transaction.
Link copied to clipboard
fun <T : Any> removeUserData(key: Key<T>): Any?
Link copied to clipboard
open override fun rollback()
Reverts all changes since the last commit or rollback operation, or to the last set savepoint, if applicable.
Link copied to clipboard
fun unregisterInterceptor(interceptor: StatementInterceptor): Boolean
Removes the specified StatementInterceptor from acting on this transaction.
Link copied to clipboard
fun <T> JdbcTransaction.withDataBaseLock(body: () -> T)
Creates table with name "busy" (if not present) and single column to be used as "synchronization" point. Table wont be dropped after execution.
Link copied to clipboard
suspend fun <T> JdbcTransaction.withSuspendTransaction(context: CoroutineContext? = null, statement: suspend JdbcTransaction.() -> T): T
Generated by Dokka © 2026 Copyright