When should I use transactions in my queries?

后端 未结 5 1851
轮回少年
轮回少年 2020-12-13 05:06

I\'m reading very detailed tutorials on how to use transactions with database types and database engines, but I haven\'t found a guide that teaches me when and why I should

5条回答
  •  被撕碎了的回忆
    2020-12-13 05:32

    In addition to what Nick Craver wrote, you would want to use a transaction when you have a series of writes that need to be performed atomically; that is, they should all succeed or none should succeed.

提交回复
热议问题