• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Something wrong with lock() method signature ?

 
Kelly Wood
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The lock() method given on my assignment does not seem right - it does not return a cookie that identifies a client, even though the comment explicitly states that the lock is used to lock a record so that it can only be updated/deleted by this client. I presume 'client' means an actual user. But in this case, is it reasonable to assume 'this client' implies 'this thread'?


 
Jeroen T Wenting
Ranch Hand
Posts: 1847
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That just means you need to be creative.
Your required locking system will force you to do things differently from most people, keeping track of clients and cookies on the server completely (you can get client specific information on the server, see my previous thread on that) rather than passing the cookie to the client and letting him send it back to you.
 
Mihai Radulescu
Ranch Hand
Posts: 918
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Kelly,

I have the same lock methodoligy like you.
If you choose to use RMI you can not assume that :

'this client' implies 'this thread'

beacuse you don't know what is hinding behind the RMI.
You must think on a other way to keep track the clients.

Regards M.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic