Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

unlock = nasty shock

 
J Hartley
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, ive done quite a bit of my project now, including criteriafind, locking/unlocking , RMI, etc
currently, my clients are free to unlock and lock which ever records they want ( ie i have no client id flying around ) . each lock is timestamped and i have a grabage collector thread running to remove old locks incase the client crashed.
but in my instructions.html it says
"The unlock method simply removes the lock from the specified record. If an attempt is made to unlock a record that has not been locked by this connection, then no action is be taken. "
hmm, this means i have to use some sort of client identification!!! im using RMI, and cant think of any way of doing it without altering the unlock signature to accept a "id" number. any other ideas?
Thanks
joe
 
Conor Allen
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yep,
I've just been reading the spec for the last while. Not sure yet how to do it but the clients must be identified ....
Guess it is time to do some research .... anyone with any bright ideas?
Conor
 
Aleksey Matiychenko
Ranch Hand
Posts: 178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Checkout creating custom SocketFactories for RMI. You can create a factory that identifies client by requesting a piece of data every time the connection is made.
I have implemented one that asks for a name of the Thread (set by a client prior)
 
J Hartley
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
cheers, ill look into that
Joe
 
J Hartley
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Urgh
i just changed the sigs to
lock( int record, String clientLockID )
and
unlock( int record, String clientLockID )
i hope i get a nice,caring and understanding examiner
Joe
 
Aleksey Matiychenko
Ranch Hand
Posts: 178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would be carefult about that.
The instructions specifically mention the signature of the lock/unlock method.
You might be taking a risk there (Or may be not).
 
J Hartley
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Doesnt it say somthing about Design Impediments and how you can make changes to the design if you justify those changes?
Cheer Joe
 
Conor Allen
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Joe,
Have you considered giving each client their own remote object object to use - as long as each client only uses one remote object then the client can be identified by the remote object it uses ...
Unless there are no guarentees that a client will use the same remote object each time ....
Anyway, just a thought
Conor
 
J Hartley
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Conor,
So you are saying use the "unreferenced" method it indicate that the client has lost contact?
Yeah I think I will try that if I have time, or if I fail first time
Cheers
Joe
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic