DB2 隔离级别

本文详细介绍了DB2数据库系统的四种不同隔离级别:RepeatableRead、ReadStability、CursorStability和UncommittedRead。每种级别的特性及可能产生的问题如幻象读、非重复读等都进行了说明。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

                                                                   DB2 Isolation Level

1Repeatable Read

If a transaction scans 1000 rows but only retrieves 10, locks are acquired and held on all 1000 rows scanned-- not just on the 10 rows retrieved.

2Read Stability

Only the rows that are actually retrieved and/or modified by the isolating transaction are locked. Thus, if a transaction scans 1000 rows but only retrieves 10, locks are only acquired and held on the 10 rows retrieved -- not on all 1000 rows scanned.

Phantoms can occur(能产生幻象读)

3. Cursor Stability

Each row that is referenced by a cursor being used by the isolating transaction is locked as long as the cursor is positioned on that row. Furthermore, if the isolating transaction modifies any row it retrieves, no other transaction can update or delete that row until the isolating transaction is terminated, even after the cursor is no longer positioned on the modified row.

non-repeatable reads and phantoms can occur(能产生非重复读和幻象读)

4. Uncommitted Read

Because rows often remain unlocked when this isolation level is used, lost updates, dirty reads, non-repeatable reads, and phantoms can occur.

The Uncommitted Read isolation level is commonly used for transactions that access read-only tables and/or transactions that execute SELECT statements of which uncommitted data from other transactions will have no adverse affect.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值