This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Can someone check my lock, I am unsure  RSS feed

 
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
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!