You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I attempted to make every Ktor pipeline its own transaction for atomicity.
My code:
this.intercept(ApplicationCallPipeline.Monitoring) {
val transaction = manager.newTransaction(manager.defaultIsolationLevel)
proceed()
transaction.commit()
transaction.close()
}
Thanks to coroutines the transaction I wanted to commit didn't match with what TransactionManager.currentOrNull() gave and it sometimes ended up being null. Resulting in this line in Exposed throwing a NullPointerException.
I managed to solve the issue by using suspended transactions like this:
I attempted to make every Ktor pipeline its own transaction for atomicity.
My code:
Thanks to coroutines the transaction I wanted to commit didn't match with what
TransactionManager.currentOrNull()
gave and it sometimes ended up being null. Resulting in this line in Exposed throwing a NullPointerException.I managed to solve the issue by using suspended transactions like this:
The problem is that Exposed still allows a NullPointerException to be thrown.
The text was updated successfully, but these errors were encountered: