• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

lockedRecords.notifyAll()

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello all,

in some of the Data methods, I check if the current record locked or not. For this case I have defined a method, that return true, if the record is locked, otherwise false.

But I am not sure, should I call the lockedRecords.notifyAll() at the end of this method?

I call lockedRecords.notifyAll() only in the unlock method, to notify that the current record was unlocked. But what about if this method will be called in the delete method or in the update? Is it correct not to call lockedRecords.notifyAll() in this method?

Can you help me?
[ January 06, 2006: Message edited by: Elena Taube ]
 
Ranch Hand
Posts: 531
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My advise to you is not to call notifyAll() at all, as it goes contrary to Sun's specification of wasting no cycles. You might wish to use queues and call notify on monitor objects in those queues.
 
reply
    Bookmark Topic Watch Topic
  • New Topic