wood burning stoves*
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 Android Security Essentials Live Lessons this week in the Android 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
 
Don't get me started about those stupid light bulbs.
 
subject: Confused about lock cookie
 
Similar Threads
Should lock methods be callable by the client
My locking model
Difference b/w Cookie and LockCookie
synchrnonized and lockCookie
B&S 2.1.1: lock(), delete() and unlock() confusion