Locking

DB2 provides isolation levels to control concurrency. In most cases, you do not need to take direct action to establish locks. In general, locks are acquired implicitly by DB2 according to the semantics defined by the isolation level.

Lock Attributes

The resource being locked is called an object. The only objects you can explicitly lock are tables and table spaces. Implicit locks on other types of objects, such as rows, index keys, and sometimes tables, are acquired by DB2 according to the isolation level and processing situations. The object being locked represents the granularity of the lock.

The length of time a lock is held is called the duration and is affected by the isolation level. The access and rules that pertain to a lock are ...

Get DB2® Universal Database™ v8 Application Development Certification Guide, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.