What's the point to enclose select statements in a transaction?

后端 未结 7 2119
渐次进展
渐次进展 2021-01-31 16:16

What\'s the point to enclose select statements in a transaction? I think select statements are just \"GET\" data from the database, they don\'t have chance to rollback something

7条回答
  •  感情败类
    2021-01-31 17:02

    A single SELECT statement is atomic to start with - enclosing it in a transaction is redundant. If there are multiple SELECT statements, you are guaranteed that no one changed anything affecting any of them until all of them complete.

提交回复
热议问题