When should I use transactions in my queries?

后端 未结 5 1855
轮回少年
轮回少年 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:08

    Transactions should be used when there is the possibility that either failure to complete or someone else reading or writing in the middle of your task could cause damage to the data. These include but are not limited to:

    • Reading from a table for subsequent deletion
    • Writing related data to multiple tables

提交回复
热议问题