隔离在同一个事务中 [英] Isolation within the same transaction

查看:91
本文介绍了隔离在同一个事务中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直认为在单个事务中没有隔离。

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

例如,如果我有2个方法M1和M2,数据库中的M1更新X M2选择X或包含X的集合。
如果两种方法都属于同一事务,并且M2在M1之后执行:

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:


  • M2是否始终看到M1更新任何类型的操作,RDBMS或隔离级别是什么?

  • 如果否,可以根据相关标准详细解释不同的可能行为

推荐答案

在上述情况下,M2总是会看到M1的更改。例如,READ COMMITTED的隔离级别仅适用于其他交易,而不适用于提供交易的交易。

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 -

Cheers -

这篇关于隔离在同一个事务中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆