• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What will the client side lock() method do?

 
Jun Gao
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'd like to know how you cope with the client side lock() method?
My idea is if the client side will lock a record, it will use lock(int) method to lock the record, inside this method, it will
call the server side's lock() method, and it will wait there until the server side returns successfully. Then I've two questions about this process:
1.how to block the client side method when it's waiting for the server's response
2.What if the connection corrupted, while the record is still in
lock in the server side? Do I need to set some timer to unlock the locked record?
What are the other ideas about the client side lock()?
 
R Bischof
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jun,
1) this is done automatically. You call something on the server and the client is blocked until the server side method returns
2) if you use the notion of a DB session (one remote session object per client) your remote session will be garbage collected by the DGC. You can use the finalize method to unlock all records locked by this session
HTH
rainer
 
kerry shih
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would shoot to have the server side impl of the lock use Java's thread locking mechanism. That way your method call won't return until the server impl gets wind of the lock acquisition.
Kerry
 
Anurag Mishra
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is no need for a lock on Client Side.
Regards
Anurag Mishra
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic