suspendTransaction
suspend fun <T> suspendTransaction( context: CoroutineContext? = null, transactionIsolation: IsolationLevel? = null, readOnly: Boolean? = null, db: R2dbcDatabase? = null, statement: suspend R2dbcTransaction.() -> T): T
Creates a new TransactionScope
then calls the specified suspending statement, suspends until it completes, and returns the result.
The TransactionScope
is derived from a new Transaction
and a given coroutine context, or the current CoroutineContext if no context is provided.
suspend fun <T> R2dbcTransaction.suspendTransaction(context: CoroutineContext? = null, statement: suspend R2dbcTransaction.() -> T): T
Calls the specified suspending statement, suspends until it completes, and returns the result.
The resulting TransactionScope
is derived from the current CoroutineContext if the latter already holds this Transaction
; otherwise, a new scope is created using this Transaction
and a given coroutine context.