Do transaction automatically rollback on error?
I was reading the docs about transactions and it is not clear whether the transaction is rolled back when an error is thrown.
Which is:
3 Replies
Yes, throwning an error is the way drizzle uses to stop execution of your transaction call back
And calling rollback accordingly
Thanks, I also tested it and throwing any kind of error makes the transaction rollback 🙂
I came here to ask the same question because it is not working in my case, but my case might be a special case. This is my code:
And this fails for me on the last insert due to https://discord.com/channels/1043890932593987624/1120919676457848946/1120919676457848946, but when I check my database, the new organization and library did get inserted.
Discord
Discord - A New Way to Chat with Friends & Communities
Discord is the easiest way to communicate over voice, video, and text. Chat, hang out, and stay close with your friends and communities.