Submitted and got feedback that my record locking was poor. Here's what I wrote, basically a two-step process that involves sleeping and polling, which I gather is the problem: LockStruct Lstr = (LockStruct)LockArray.get(record); synchronized (Lstr.Lock) { while ( Lstr.Locked ) { try { Thread.sleep( sleepTime ); } catch (InterruptedException ex) {} } Lstr.ThreadThatHasLock = Thread.currentThread(); Lstr.Locked = true; Any suggestions?
Sam Wong
Ranch Hand
Joined: Dec 07, 2000
Posts: 133
posted
0
Off the top of my head, maybe you can try an event notification model to notify interested listeners that the record is freed. The listener may be a record locking manager that handles record locking requests. Just an idea. Hope it will spark your own ideas about this.