+ -
当前位置:首页 → 问答吧 → Ubuntu 9.04安装Oracle 11,备案!!

Ubuntu 9.04安装Oracle 11,备案!!

时间:2010-12-03

来源:互联网

网上找到一些对Repeatable Read(可重复读)的解释,我大致翻译了一下:
代码:
The first time that a read is performed on a table results in that view of the table being preserved throughout that transaction.
在一个事务中,当第一次读一张表时,会立即被保存该表的一个视图。

Any changes made on that table committed by other transactions after that point are not seen.
在这之后,任何其他事务对这个表的改变本事务是看不到的。

However, if a different transaction commits a change between the time that you start your transaction and the time that you perform your first read on that table, you will see the changes made by that other transaction.
但是,如果一个不同的事务在你开启事务后第一次读之前提交了对该表的一个更新,你可以看到这些事务提交的改变。

大家最好看英文原文,这样原汁原味一些,如果我的翻译不准确请指出。
从以上描述中可以看出,repeatable隔离层级下,对于读操作确实保证多次read出来的结果是一致,但却看不出来如果防止第二类更新丢失的。

所谓第二类更新丢失:
代码:
              trsaction1             trsaction2
time1         read  i
time2                                        read i
time3         ++i并提交事务               
time4                                   ++i提交事务

这种情况下trsaction2的操作盖掉了 trsaction1 的操作,i被少+了一次

求解释repeatable隔离层级是如何实现防止第二类更新丢失的

作者: gzbao9999   发布时间: 2010-12-03