• 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

LockManager

 
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
After going thru some posts in this forum I understand that the LockManager is Singleton and can be instantiated by calling its getIntance() method. Now I have following doubts:
I. Where does it resides(in suncertify.server???) and where do we call that(in both DataAccessRemote and DataAccessLocal???)
2. Whether the methods, namely
lock(clientID,recNo)
and unlock(clientID,recNO) to be defined in this class??
Thanks
Padmaja
 
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Padmaja,


After going thru some posts in this forum I understand that the LockManager is Singleton ...


I don't want to get into a philosophical argument here but a LockManager is not necessarily a singleton. It absoulutely was not in my design.


I. Where does it resides(in suncertify.server???) and where do we call that(in both DataAccessRemote and DataAccessLocal???)


I put mine in the suncertify.db package, but I suppose it could go in suncertify.server just as well. No need to call it in local mode. My local implemetation had no-op versions of lock() and unlock() so just did nothing.


2. Whether the methods, namely
lock(clientID,recNo)
and unlock(clientID,recNO) to be defined in this class??


That's what I did and that seems to be the most appropriate in my opinion.
Hope this helps,
Michael Morris
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
LockManager does not need to be a singleton. Just code you assignment so that there is only one instance. Just like the Data class.
As a bunch of us say here, Singleton pattern is way over used. and here is an instance where it is wrong to use it.
Hope that Helps.
Mark
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic