数据库操作的隔离级别 Transaction Isolation Levels
by yan 20220223
-
ANSI/ISO Transaction Isolation Levels(ANSI/ISO標準的隔離級別)
(1)未提交讀(read uncommitted)
(2)提交讀 或 不可重復讀(read committed)
(3)重復讀(repeatable read)
(4)序列化(Serializable) -
isolation levels 的一些表現
(1)Dirtyreads(臟讀)
Atransaction reads data that has been written by another transaction that hasnot been committed yet.
–一個事務讀取另一個事務已經修改但為提交的數據
(2)Nonrepeatable (fuzzy) reads(模糊讀)
Atransaction rereads data it has previously read and finds that anothercommitted transaction has modified or deleted the data. For example, a userqueries a row and then later queries the same row, onlyto discover that the data has changed.
–當事務重讀之前的數據時,發現這個事務被另一個事務修改,如modified 或者deleted,并且已經提交。
(3)Phantomreads
Atransaction reruns a queryreturning a set of rows that satisfies a search condition and finds thatanother committed transaction has inserted additional rows that satisfy thecondition.
–同一查詢在同一事務中多次進行,由于其他提交事務所做的插入操作,每次返回不同的結果集,此時發生幻像讀。 -
隔離級別與并發性
隔離級別與并發性是互為矛盾的:隔離程度越高,數據庫的并發性越差;隔離程度越低,數據庫的并發性越好。
-
java里的定義
總結
以上是生活随笔為你收集整理的数据库操作的隔离级别 Transaction Isolation Levels的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 云胶水-极简运维平台
- 下一篇: 解决Word自动生成目录时,目录里出现正