Win a copy of Design for the Mind this week in the Design 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
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic