Kbase P136338: How to avoid dirty reads when using Optimistic locking
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  30/01/2009 |
|
Status: Unverified
GOAL:
How to avoid dirty reads when using Optimistic locking
GOAL:
How to avoid errors when accessing records with NO-LOCK such as "recid <RECID> not part of file <FILENUMBER>"
FACT(s) (Environment):
All Supported Operating Systems
Progress/OpenEdge Product Family
FIX:
When employing an optimistic record locking strategy it is possible for a procedure to find that the record being worked on has been changed or deleted since it was originally retrieved from the database.
Programmatically there are many ways to handle such a scenario. Some choose to update a retrieved record with an ?in-use? indicator or counter to signify that the record is currently locked, effectively simulating a ?lock?.
One risk with this approach is if the client owning the lock should fail to complete successfully, the in-use indicator may never get unset. Ultimately, whatever approach is taken when implementing any strategy such as this, it is important it is implemented consistently and throughout the entire code base of the application.