aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes lockCookie clarification request ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "lockCookie clarification request ?" Watch "lockCookie clarification request ?" New topic
Author

lockCookie clarification request ?

Harry Henriques
Ranch Hand

Joined: Jun 17, 2009
Posts: 206
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

Joined: Dec 28, 2007
Posts: 2267
    
    3

Howdy, Harry!

Is this correct?


Yup! That's pretty much it!


Cheers, Bob "John Lennon" Perillo
SCJP, SCWCD, SCJD, SCBCD - Daileon: A Tool for Enabling Domain Annotations
Harry Henriques
Ranch Hand

Joined: Jun 17, 2009
Posts: 206
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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: lockCookie clarification request ?