https://kotlinlang.org logo
#jasync-sql
Title
# jasync-sql
h

Henry

11/21/2020, 12:36 PM
Morning everyone, just got a new blog post up about implementing transactions with jasync-sql and Ktor, would love any feedback and hopefully someone finds it useful https://henrycourse.com/2020/11/21/jasync-sql-transactions/
👏 1
o

oshai

11/21/2020, 10:44 PM
Thanks for the post! I have a couple of minor suggestions: • if you add a usage example it will be nice and easier to grasp for readers, • Maybe add a link to complete code in github? • Have you checked SuspendingConnection? It might help with some of the things you did: https://github.com/jasync-sql/jasync-sql/blob/master/db-async-common/src/main/java/com/github/jasync/sql/db/SuspendingConnection.kt and https://github.com/jasync-sql/jasync-sql/wiki/Kotlin-API#kotlin-coroutines-support
h

Henry

11/22/2020, 1:02 AM
thanks a lot for the feedback, all good points and will check out suspending connections tomorrow!
Thanks for the heads up on this, I see that the
SuspendingConnection
uses the pool's dispatcher (if the
connection
is a pool) when executing queries in a transaction. I overlooked that which might lead to some unexpected behaviour
5 Views