This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

lockCookie clarification request ?

 
Harry Henriques
Ranch Hand
Posts: 206
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Fellow Bloggers,

I have read a half dozen blog entries concerning locking and unlocking records for update/delete operations. I'm beginning to understand the necessity for a locking cookie associated with a specific record number. The suggestion has been made that developers should create a HashMap<recNo, cookie>, and enter a key-value pair each time a record is locked. My question is the following:

If I understand correctly, the recNo in the HashMap<recNo, cookie> uniquely identifies the database record upon which an update/delete operation is going to occur. If I understand correctly, the cookie in the HashMap<recNo, cookie> uniquely identifies the client who has permission to perform an update/delete operation on the specific recNo. When the recNo and the lockCookie are passed as arguments to the update() method, the recNo identifies the record that will be updated and lockCookie identifies the client who has permission to perform the update.

Is this correct?

Thanks,
Harry Henriques
 
Roberto Perillo
Bartender
Posts: 2271
3
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howdy, Harry!

Is this correct?


Yup! That's pretty much it!
 
Harry Henriques
Ranch Hand
Posts: 206
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Roberto. I have a follow-up question about synchronization, but it will have to wait until I've thought about this problem a little more. -Harry
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic