docs/api/exposed-r2dbc/org.jetbrains.exposed.v1.r2dbc/-r2dbc-transaction/index.html
open class R2dbcTransaction(transactionImpl: R2dbcTransactionInterface) : Transaction, R2dbcTransactionInterface
Class representing a unit block of work that is performed on a database using an R2DBC driver.
MembersMembers & Extensions
Link copied to clipboard
constructor(transactionImpl: R2dbcTransactionInterface)
Link copied to clipboard
object Companion
Link copied to clipboard
var currentStatement: R2dbcPreparedStatementApi?
The currently executing statement.
Link copied to clipboard
override val db: R2dbcDatabase
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 R2dbcException happens.
Link copied to clipboard
var minRetryDelay: Long
The minimum number of milliseconds to wait before retrying this transaction if an R2dbcException happens.
Link copied to clipboard
open override val outerTransaction: R2dbcTransaction?
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: IsolationLevel?
The transaction isolation level of the transaction, which may differ from the set database level.
Link copied to clipboard
open override val transactionManager: R2dbcTransactionManager
Link copied to clipboard
var warnLongQueriesDuration: Long?
Link copied to clipboard
override fun addLogger(vararg logger: SqlLogger): CompositeSqlLogger
Link copied to clipboard
fun clearExecutedStatements()
Clears all previously executed statements and resets or releases any used database and/or driver resources.
Link copied to clipboard
open suspend override fun close()
Closes the transaction and releases any savepoints.
Link copied to clipboard
open suspend override fun commit()
Saves all changes since the last commit or rollback operation.
Link copied to clipboard
open suspend override fun connection(): R2dbcExposedConnection<*>
Retrieves the database connection used by the transaction.
Link copied to clipboard
suspend fun <T> exec(stmt: SuspendExecutable<T, *>): T?
Executes the provided Statement object and returns the generated value.
suspend fun <T, R> exec(stmt: SuspendExecutable<T, *>, body: suspend 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.
suspend fun exec(stmt: String, args: Iterable<Pair<IColumnType<*>, Any?>> = emptyList(), explicitStatementType: StatementType? = null)
suspend fun <T : Any> exec(stmt: String, args: Iterable<Pair<IColumnType<*>, Any?>> = emptyList(), explicitStatementType: StatementType? = null, transform: (Row) -> T?): Flow<T?>?
Executes the provided statement exactly, using the supplied args to set values to question mark placeholders (if applicable).
Link copied to clipboard
suspend 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
suspend fun <R> execQuery(query: SuspendExecutable<ResultApi, *>, body: suspend Statement<ResultApi>.(R2dbcResult) -> R): R?
Executes the provided query object, retrieves the generated result wrapped as a R2dbcResult, then calls the specified function body with this generated value as its argument and returns its result.
Link copied to clipboard
fun R2dbcTransaction.explain(analyze: Boolean = false, options: String? = null, body: StatementBuilder.() -> Statement<*>): ExplainSuspendExecutable
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.
fun registerInterceptor(interceptor: SuspendStatementInterceptor): Boolean
Adds the specified SuspendStatementInterceptor to act on this transaction.
Link copied to clipboard
fun <T : Any> removeUserData(key: Key<T>): Any?
Link copied to clipboard
open suspend 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.
fun unregisterInterceptor(interceptor: SuspendStatementInterceptor): Boolean
Removes the specified SuspendStatementInterceptor from acting on this transaction.
Link copied to clipboard
suspend fun <T> R2dbcTransaction.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.
Generated by Dokka © 2026 Copyright