release lock on table

Gizmo

New Member
Hello,

Progress 91C
Win 2000

Can anyone tell me what is the best way to release a lock on a table /temp-table?

find first tablename exclusive-lock no-error.

release tablename OR
find current tablename no-lock no-error ?
 
The answer to this is a bit more complex than "just release the record"

When you retrieve a record with an exclusive lock in Progress, you WILL be within a transaction in that procedure (and possibly within another transaction from the calling procedure but we'll ignore that for now!)

The record will not be fully released and available for another record to lock for updates until the transaction scope end.

At the end of the transaction scope, the database will do one of 2 things.

1. If the record is scoped to the same block (or an inner block) as the transaction then the lock will be removed and the record made available. The record will not be available during the rest of the procedure.

2. If the record is scoped to a block outside the transaction then the lock will be downgraded to a share lock. This can be alleviated by putting a RELEASE statement immediately prior to the transaction end (which will release the record completely, or by re-finding the record with a no-lock immediately afetr the transaction scope ends.

Personally I think that the second scenario should only exist where carefully documented and commented within the code.
 
Back
Top