Hey guys. I am looking for some best practices / t...
# ktor
d
Hey guys. I am looking for some best practices / tuts ,/ etc. for Ktor in combination with Kotlin exposed especially about using transactions in coroutines! Would appreciate any suggestions.
d
Yeah I already stumbled across this one! My problem is that when I use
withContext() { transaction{}}
I get an
no transaction context found error
when working with the DAO and many to many relations.
r
Unfortunately I haven't used Exposed with this types of relations. Only very simple foreign keys.
d
Exposed does not support coroutines. The reasoning is that it wraps jdbc which is a blocking api. It intends to add coroutine support though. For the time being, your best bet is not to change thread in the context of a transaction.
👍🏼 2