Kbase P6970: Can there be a SHARED-LOCK on a Database Record without any active TRANSACTION?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  12/04/2010 |
|
Status: Verified
GOAL:
Can there be a SHARED-LOCK on a Database Record when NO TRANSACTION is active?
GOAL:
Can there be a SHARED-LOCK on a Database Record without any active TRANSACTION?
FACT(s) (Environment):
All Supported Operating Systems
Progress/OpenEdge Product Family
FIX:
YES. A Procedure of a PLIP (Persistent Library of Internal Procedure) can fetch a record in EXCLUSIVE-LOCK mode.
When the flow of the program goes out of the procedure, then the record is kept locked and the lock is downgraded to SHARED-LOCK if that record was not released, as illustrated bellow: DEFINE VARIABLE h AS HANDLE NO-UNDO.
RUN PersLock.p PERSIST SET h.
RUN KeepIt IN h.
MESSAGE "Now have a look in the Promon at Record Locking Table and Transaction Control"
VIEW-AS ALERT-BOX INFO BUTTONS OK
/*PersLock.p*/
PROCEDURE KeepIt:
FIND FIRST customer EXCLUSIVE.
END.