Isolation within the same transaction

时光总嘲笑我的痴心妄想 提交于 2020-01-06 15:07:35

问题


I've always considered that there were no isolation within a single transaction.

For example if I have 2 methods M1 and M2, M1 update X in database and M2 select X or a set containing X. If both method belongs to the same transaction and M2 is executed after M1:

  • Does M2 always seen M1 update whatever the type of operation, the RDBMS or the isolation level is ?
  • If no, can someone explain in details the different possible behavior according to associated criteria

回答1:


In the situation described, M2 will always see M1's changes yes. An isolation level of READ COMMITTED, for example, only applies to other transactions, not the transaction supplying it.

Cheers -



来源:https://stackoverflow.com/questions/20948872/isolation-within-the-same-transaction

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!