Kbase P147933: What is the default lock strength in progress?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  6/12/2009 |
|
Status: Unverified
GOAL:
What is the default lock strength in progress?
GOAL:
How to make NO-LOCK the default lock strength for queries that do not specify SHARE-LOCK or EXCLUSIVE-LOCK?
FACT(s) (Environment):
All Supported Operating Systems
Progress/OpenEdge Product Family
FIX:
The default lock strength for Progress / OpenEdge is SHARE-LOCK.
When a query is made such as:
FOR EACH CUSTOMER:
A share lock is taken on each record of the customer table, one at a time, until all the records of the table are read.
Share locks present the possibility for a situation called a DEADLY EMBRACE.
If two client have share-locks on the same record and both attempt to update the record they will mutually block each other as a share-lock can not be raised to an EXCLUSIVE-LOCK while any other shared locks are held on the record.
One of the clients would eventually hit the Lock Wait Timeout duration and release the record and the other client session would then acquire the lock (unless more than one client is holding a share-lock in which case the cycle might never end).
To make NO-LOCK the default lock strength if no lock strength is listed in a query statement the code needs to be compiled by a client session using the -NL (NO-LOCK) startup parameter.
For the duration of the session any query which doesn't specify a lock strength (i.e. EXCLUSIVE-LOCK, SHARE-LOCK, NO-LOCK) would implicitly become a NO-LOCK query.
Any code compiled by a session started using the -NL startup option will later run with this locking algorithm behavior.
It is not possible to change the locking default in pre-existing code compiled without the -NL startup parameter.