Đang chuẩn bị liên kết để tải về tài liệu:
Microsoft SQL Server 2008 R2 Unleashed- P146

Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ

Microsoft SQL Server 2008 R2 Unleashed- P146:SQL Server 2005 provided a number of significant new features and enhancements over what was available in SQL Server 2000. This is not too surprising considering there was a five-year gap between these major releases.Microsoft SQL Server 2008 is not as much of a quantum leap forward from SQL Server 2005 | 1394 CHAPTER 37 Locking and Performance equivalent to the Serializable Read isolation level. The following hypothetical example demonstrates the usage of the HOLDLOCK statement within a transaction declare @seqno int begin transaction -- get a UNIQUE sequence number from sequence table SELECT @seqno isnull seq 0 1 from sequence WITH HOLDLOCK -- in the absence of HOLDLOCK shared lock will be released -- and if some other concurrent transaction ran the same -- command both of them could get the same sequence number UPDATE sequence set seq @seqno --now go do something else with this unique sequence number commit tran NOTE As discussed earlier in this chapter in the Deadlocks section using HOLDLOCK in this manner leads to potential deadlocks between processes executing the transaction at the same time. For this reason the HOLDLOCK hint as well as the REPEATABLEREAD and SERIALIZABLE hints should be used sparingly if at all. In this example it might be better for the SELECT statement to use an update or an exclusive lock on the sequence table using the hints discussed later in this chapter in the section Lock Type Hints. Another option would be to use an application lock as discussed previously in this chapter in the section Using Application Locks. NOLOCK You can use this option to specify that no shared lock be placed on the resource. This option is similar to running a query at Isolation Level 0 Read Uncommitted which allows the query to ignore exclusive locks and read uncommitted changes. The NOLOCK option is a useful feature in reporting environments where the accuracy of the results is not critical. READUNCOMMITTED This is the same as specifying the Read Uncommitted mode when using the SET TRANSACTION ISOLATION LEVEL command and it is the same as the NOLOCK table hint. READCOMMITTED This is the same as specifying the Read Committed mode when you use the SET TRANSACTION ISOLATION LEVEL command. The query waits for exclusive locks to be released before reading the .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.