suspendTransaction

suspend fun <T> suspendTransaction(db: R2dbcDatabase? = null, statement: suspend R2dbcTransaction.() -> T): T

Creates a transaction then calls the statement block with this transaction as its receiver and returns the result.

Note If the database value db is not set, the value used will be either the last R2dbcDatabase instance created or the value associated with the parent transaction (if this function is invoked in an existing transaction).

Return

The final result of the statement block.


suspend fun <T> suspendTransaction(transactionIsolation: IsolationLevel, readOnly: Boolean = false, db: R2dbcDatabase? = null, statement: suspend R2dbcTransaction.() -> T): T

Creates a transaction with the specified transactionIsolation and readOnly settings, then calls the statement block with this transaction as its receiver and returns the result.

Note If the database value db is not set, the value used will be either the last R2dbcDatabase instance created or the value associated with the parent transaction (if this function is invoked in an existing transaction).


suspend fun <T> suspendTransaction(context: CoroutineContext? = null, transactionIsolation: IsolationLevel? = null, readOnly: Boolean? = null, db: R2dbcDatabase? = null, statement: suspend R2dbcTransaction.() -> T): T

Deprecated (with error)

This method overload will be removed in release 1.0.0. It should be replaced with either overloadthat does not take a `CoroutineContext` as an argument.