This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Confused about lock cookie Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Confused about lock cookie" Watch "Confused about lock cookie" New topic
Author

Confused about lock cookie

Ronnie Phelps
Ranch Hand

Joined: Mar 12, 2001
Posts: 329
I am taking the beta 1.4 exam and I am kind of confused about the lock cookie concept. I made a few assumptions that I'm not sure about:
1. the lockCookie attribute is just an arbitrary numeric value that you can increment after the server is locked or unlocked.(this value isn't obtained from any core library function calls)
2. There should only be one lockCookie and this must be released by clients during an unexpected event such as a client losing a connection before the lock is released.
Again these are just assumption I made. Let me know what you think.
Tybon Wu
Ranch Hand

Joined: Jun 18, 2002
Posts: 84

1. the lockCookie attribute is just an arbitrary numeric value that you can increment after the server is locked or unlocked.(this value isn't obtained from any core library function calls)

That's my intepretation too.

2. There should only be one lockCookie and this must be released by clients during an unexpected event such as a client losing a connection before the lock is released.

At most one lockCookie per record at any given time. The server should unlock all records locked by the client which crashed.


SCJP2
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Confused about lock cookie