• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

whose responsibility it is to lock/unlock record ?

 
Bigwood Liu
Ranch Hand
Posts: 240
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I read some discussions about lock/unlock here, but i still have a question:
who will deal with lock/unlock operation? the server or the client?
As i understand, it can work this way: the client raise a thread, which call lock->read->modify->unlock in turn, thus, during this process, no client ID is required.
Or, it may be: the server manage the thread, and lock/unlock the record, thus the server will track the client(it seems difficult to do). In addition, I am not clear about the issue of LockManager vs. LockedMap.
Thank you for your comment.
Regards

Damu
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The locking operation definitely falls under the data side. Meaning in remote it happens on the server, and locally it happens with the data classes.
A LockManager handles locking on behalf of the database, and is an elegant solution.
Search on this forum for more detailed posts on this solution.
Mark
 
Bigwood Liu
Ranch Hand
Posts: 240
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you Mark !
How dose the server start a new thread to serve the client?
say, at the client side:

Then the RemoteData will call corresponding
modify() method at server side. where is the thread that serve the client, how can i start it?
Thank you for help
Regards
Damu
[ April 22, 2003: Message edited by: damu liu ]
[ April 22, 2003: Message edited by: damu liu ]
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Damu, if you do a search on this forum for Connection, you will find the way to handle Connection objects for each client.
Basically the idea is to have a ConnectionFactory, that is in the RMI Registry. When a client connects to the server, it looks up this object, and calls a getConnection method which returns an object just for that client that is a Connection object. This object will stay on the server and act as the clients unique object.
Good Luck
Mark
 
Bigwood Liu
Ranch Hand
Posts: 240
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much, Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic