線上訂房服務-台灣趴趴狗聯合訂房中心
發文 回覆 瀏覽次數:2525
推到 Plurk!
推到 Facebook!

請問ADO的IsolationLevel的各種使用時機

缺席
frappe
中階會員


發表:88
回覆:114
積分:95
註冊:2008-10-21

發送簡訊給我
#1 引用回覆 回覆 發表時間:2009-03-07 03:35:06 IP:115.83.xxx.xxx 訂閱
沒人回答,先設缺席了

看了說明還是不太懂有什麼差別,
請問下面這些狀況要選哪種?
1.編輯某筆資料的時候,其他使用者不能修改這筆資料(未BeginTrans)
2.編輯某筆資料的時候,其他使用者不能修改這筆資料(BeginTrans)
3.編輯資料的時候整張Table Lock,其他人都不能編輯
4.不知道還有什麼像的情況............

ilUnspecified
Server is using a an isolation level other than what was requested and the specific isolation level cannot be determined.
ilChaos
Changes from more highly isolated transactions cannot be overwritten by the current connection.
ilReadUncommitted
Uncommitted changes in other transactions are visible.
ilBrowse
Uncommitted changes in other transactions are visible.
ilCursorStability
Changes from other transactions only visible after being committed.
ilReadCommitted
Changes from other transactions only visible after being committed.
ilRepeatableRead
Changes made in other transactions not visible, but requerying can retrieve new recordsets.
ilSerializable
Transactions conducted in isolation from other transactions.
ilIsolated
Transactions conducted in isolation from other transactions.
編輯記錄
frappe 重新編輯於 2009-03-23 19:37:16, 註解 無‧
GrandRURU
站務副站長


發表:240
回覆:1680
積分:1874
註冊:2005-06-21

發送簡訊給我
#2 引用回覆 回覆 發表時間:2016-05-07 23:21:09 IP:211.79.xxx.xxx 未訂閱
ilIsolated is equal to ilSerializable, and means that all transactions are fully isloated from other transactions.
ilRepeatableRead means that we see the snapshot of the data, and won't see any changes until we re-query the database, a bit similar to the BDE's tiRepeatableRead option.
ilReadCommitted is equal to ilCursorStability (the default dbGo for ADO isolation level), which means that we can only see changes from other transactions after they have been committed – this is equal to the BDE tiReadCommitted option.
ilBrowse is equal to ilReadUncommitted which means that we can also see changes that have not yet been committed (and can potentially rollback) – similar to the tiDirtyRead option of the BDE.
ilChaos means that we cannot overwrite changes from higher-isloated transactions.
ilUnspecified finally just indicates that Delphi was unable to determine the exact isolation level which is currently being used.Fortunately, this result doesn't occur often (it never happened to me in real-world projects).

詳見:
Using Database Transactions in Delphi VCL Applications. http://www.drbob42.com/examines/examin95.htm
系統時間:2024-04-20 17:42:20
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!