technical notes

Tháng Chín 22, 2007

Các level transaction (IsolationLevel Enumeration)

Chuyên mục: Database — ngduy @ 8:44 sáng

Specifies the transaction locking behavior for the connection.

The IsolationLevel values are used by a .NET Framework data provider when performing a transaction.

The IsolationLevel remains in effect until explicitly changed, but it can be changed at any time. The new value is used at execution time, not parse time. If changed during a transaction, the expected behavior of the server is to apply the new locking level to all statements remaining.

Member name Description
Chaos The pending changes from more highly isolated transactions cannot be overwritten.
ReadCommitted Shared lock sẽ giữ khi data đang đọc để tránh dirty reads, nhưng data có thể thay đổi trước khi kết thúc một transaction. Kết quả là non-repeatable reads hay phantom data.
ReadUncommitted A dirty read is possible, meaning that no shared locks are issued and no exclusive locks are honored.
RepeatableRead Lock được đặt trên toàn data query, ngăn không cho người khác update data trong khi thực hiện transaction. Ngăn ngừa được việc đọc không liên tục nhưngphantom rows vẫn có thể xuất hiện.
Serializable A range lock đặt trong DataSet, không cho users khác update hay insert row vào dataset cho tới khi transaction complete.
Snapshot Giảm blocking bằng cách lưu 1 version của data để một ứng dụng có thể đọc trong khi một ứng dụng khác modify data. Trong một transaction đó sẽ không thể nhận được sự thay đổi data cho dù requery.
Unspecified A different isolation level than the one specified is being used, but the level cannot be determined.When using OdbcTransaction, if you do not set IsolationLevel or you set IsolationLevel to Unspecied, the transaction executes according to the default isolation level of the underlying ODBC driver.
 (Chỉ dịch trước chỗ nào quan trọng và sử dụng nhiều thôi.)

No Comments Yet »

Chưa có phản hồi.

RSS các phản hồi của bài viết này. URL TrackBack

Để lại phản hồi

Blog at WordPress.com.