[progress Communities] [progress Openedge Abl] Forum Post: Re: Deadlock

  • Thread starter Thread starter David Abdala
  • Start date Start date
Status
Not open for further replies.
D

David Abdala

Guest
I may be wrong, but that doesn't sounds enough for a deadlock. You need at least two records lock to get a deadlock: Proc1 has a lock on Rec1, Proc2 has a lock on Rec2, then Proc1 tries to get a lock on Rec2 and Proc2 on Rec1 == 'deadlock'. Your example is not enough for a deadlock, one of the procs will get the lock and exit, and then the other will do. To avoid multirecord deadlocks, you need to get all the locks before doing the job and, if any lock fails, release all the records, and retry (or fail). That means having as many buffers as required: def buffer b1 for table. def buffer b2 for table. find b1 exclusive-lock. find b2 exclusive-lock. if not available b1 or no available b2 then release and exit. do the job. release and exit.

Continue reading...
 
Status
Not open for further replies.
Back
Top