• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

LockManager

 
Padmaja Prasad
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • 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
 
Michael Morris
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
  • 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
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • 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.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic