robin
02/24/2020, 3:38 PMtapac
02/24/2020, 5:01 PMrobin
02/24/2020, 8:27 PMtransaction
-functions, not the suspend or async ones, and not switching Threads or dispatchers from inside a transaction, as far as I can tell, so the code inside of transactions should run fully blocking, right?tapac
02/24/2020, 8:40 PMrobin
02/25/2020, 7:18 AMtapac
02/25/2020, 8:27 AMtransaction
with suspendedTransaction
or newSuspendedTransaction
robin
02/25/2020, 10:00 AMtransaction
with newSuspendedTransaction
was not enough, as the latter doesn't automatically check if there's a transaction already in scope which to attach to, and always creates a completely new transaction instead, leading to outer transactions not being able to see changes made by inner transactions. We solved that by implementing our own transaction
function that checks for an already open transaction in the coroutine context, and delegates to suspendedTransaction
or newSuspendedTransaction
accordingly. I was surprised that exposed doesn't seem to have that functionality - is this a conscious omission, or something you would welcome a pull request for? Our implementation isn't that elaborate, it wouldn't be much work to integrate it into exposed itself, so that we can have a true suspending pendant to transaction
.