Das135
09/03/2020, 1:38 PMtransaction {
FirstObject.selectAll()
supplyAsync {
runBlocking {
SecondObject.selectAll()
}
}
}
I need to do both calls inside one transaction.
When calling SecondObject.selectAll()
, I got exception No transaction in context
. https://github.com/JetBrains/Exposed/wiki/Transactions#working-with-coroutines -> This should probably help me, but I did not fully understand how to use it.tapac
09/03/2020, 2:39 PMtransaction {
FirstObject.selectAll()
val result = async {
suspendedTransaction {
SecondObject.selectAll().toList()
}
}
println("${result.await()}")
}