suspendedTransactionAsync

suspend fun <T> suspendedTransactionAsync(context: CoroutineContext? = null, db: Database? = null, transactionIsolation: Int? = null, statement: suspend Transaction.() -> T): Deferred<T>

Creates a new TransactionScope and returns its future result as an implementation of Deferred.

The TransactionScope is derived from a new Transaction and a given coroutine context, or the current CoroutineContext if no context is provided.

Samples

org.jetbrains.exposed.sql.tests.shared.CoroutineTests.suspendTxAsync