Quote:
|
Originally Posted by gabrielefrank
Hello Marcus,
what do you mean when you say "So if E1 is holding locks on data that E2 needs"? For you "needs" means " need to lock"? Else you contradict your previous statement....
Thank you for the answer
G
|
DB2 is a pessimistic locking database in that it automatically locks based on the SQL statement executed, and in some cases dependent on the isolation level and release/commit parms.
So if E1 is holding locks on data and E2 needs to acquire a lock (the lock is acquired automatically by DB2 in order to execute an SQL statement) that is not compatible with the locks E1 already has, then E2 will have to wait (or eventually time-out).
For example, a lock taken for "select for update" is compatible with a lock taken for a "select" (assuming the select is read only). But two locks that are both "select for update" (assuming they are coming from different applications) are not compatible with each other (cannot exist concurrently).