The database system allows competing transactions to access the same database objects. Locks are required to guarantee that parallel processes are synchronized and individual transactions isolated.
Name |
System Name |
Description |
Objects that Can Be Locked |
---|---|---|---|
Shared lock |
SHARE LOCK |
Other transactions retain read access to the database object and can continue to set shared locks for this database object. |
Tables, rows, database catalog |
Exclusive lock |
EXCLUSIVE LOCK |
Other transactions have neither read nor write access to the database object. All SQL statements that change data, such as INSERT, UPDATE and DELETE statements, always request an exclusive lock. |
Tables, rows, database catalog |
Optimistic lock |
- |
Keeps track of changes to a database object Other transactions can continue to set shared, exclusive or optimistic locks for the database object. |
Rows |