• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can someone check my lock, I am unsure

 
Ed Tse
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am still unsure about how I handle the lock. This requirement bother me the most "Locks a record so that it can only be updated or deleted by this client". I cannot identify the client other than using the thread id. This works under the assumption that the lock and unlock is done under one thread. Is this a valid assumption? Under the remote case, I did not expose the lock and unlock in the remote interface, so all lock and unlock are done in one RMI call which use one single thread. Am I good or am I missing some use cases?

 
Ed Tse
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
btw, lockedRecords is just a Hashtable<Integer, Long> containing record numbers and thread ids
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic