Modes of Locking (334)

tsinglee發表於2007-12-09

Oracle uses two modes of locking in a multiuser database:
■ Exclusive lock mode prevents the associates resource from being shared. This lock
mode is obtained to modify data. The first transaction to lock a resource
exclusively is the only transaction that can alter the resource until the exclusive
lock is released.
■ Share lock mode allows the associated resource to be shared, depending on the
operations involved. Multiple users reading data can share the data, holding share
locks to prevent concurrent access by a writer (who needs an exclusive lock).
Several transactions can acquire share locks on the same resource.

鎖的型別
1. 排他鎖 : 阻止被鎖定的資源共享. 對資料進行修改時,需要或得這種鎖.第一個排他地對資源加
鎖的事物是唯一可以對此資源進行修改的事物,直至排他鎖被釋放
2. 共享鎖 : 根據操作型別 , 允許被鎖定的資源共享 . 多個事務可對相同的資源加共享鎖

[@more@]

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/10599713/viewspace-990396/,如需轉載,請註明出處,否則將追究法律責任。

相關文章