This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

client ID for lock/unlock

 
no more user
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i see this in instructions..
... If an attempt is made to unlock a record that has not been locked by this connection, then no action is be taken

to do this i have see many coments, such pass to the server a client object.. but, hm
i can do like this?
the server return a int by lock method wich identify this record locking order, and a subsequent unlock could pass this int with the recNum to unlock else the unlock no make effect, or have to be a same identifier for all time of connection of client..
i like java and
thanks in advance !
 
Ying Ren
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I follow the popular solution, that you should create a lockmagager class in your server side. Since, the lock and unlock are only used in remote mode. And in your remote data class which should provide all the services that data class provides, you instance a new lockmanager class using this remote data class, thus, you can track the lock owner all the time.
YING REN
 
Michael Morris
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Alex,
I agree with Ying that you should use a lock manager and OO methodology to map clients to locked records, but many have taken your approach and passed the certification. I would encourage you though to design it in such a way that you are not forced to change the signatures of lock and unlock in your public Data interface.
Hope this helps,
Michael Morris
[ August 07, 2002: Message edited by: Michael Morris ]
 
Max Habibi
town drunk
( and author)
Sheriff
Posts: 4118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Alex,
You'll be able to find a detailed discussion of all issues regarding locking here
HTH,
M, author
The Sun Certified Java Developer Exam with J2SE 1.4
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic