Transaction rollback
Hello guys. Kind of dumb question but should I cover body of transaction in try/catch and call rollback explicitly? Here is an example. What will happen some query throws an error in transaction callback?
6 Replies
No, the transaction is rolled back automatically
sessionId will be undefined or error will propagate further?
the
await db.transaction
call will throw
in other words, .transaction
will return a rejected Promiseperfect. Maybe it worth to mention this in docs. I didn't find any info about rollback. Thank you!
yes, we're currently working on the proper docs website
thanks for the feedback!
Thanks for awesome library! Have a great weekends)