aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes a locking question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "a locking question" Watch "a locking question" New topic
Author

a locking question

Alex Gregory
Ranch Hand

Joined: Jun 15, 2002
Posts: 46
hi, i finished my assignment but now am a bit worried. I did not modify the sigs of lock or unlock. I implemented an atomic booking operation which calls lock and unlock in one method. Therefore, if Sun makes some test program where client a locks record 1 and client b unlocks record 1, the unlock will be successful.
Thus, for the spec of the assignment, i'm fine, but if they try to call the lock and unlock out of context of my atomic operation, i'm in trouble.
Can anyone tell me anything?
John Smith
Ranch Hand

Joined: Oct 08, 2001
Posts: 2937

Therefore, if Sun makes some test program where client a locks record 1 and client b unlocks record 1, the unlock will be successful.
Thus, for the spec of the assignment, i'm fine,

No, you are not fine. The requirement is clear:
"If an attempt is made to unlock a record that has not been locked by this connection, then no action is be taken". So if in your program client A locks record 1 and client B can unlock it, you will lose some 10 points (in my estimate, since the total for locking is 30 points).
Eugene.
Alex Gregory
Ranch Hand

Joined: Jun 15, 2002
Posts: 46
Thanks Eugene, I figured the same thing. It's going to be a minor change, but you're right about not meeting the specs, cause even though i dont do the situation i describe, they might in the grading.
Jack Yang
Ranch Hand

Joined: Jan 31, 2002
Posts: 59
Hi Alex,
Can you say more about your locking?How can you solve it?I'm confuse about it.
Thank you


SCJD2,SCBCD,SCJWD,SCJP2
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17257
    
    6

"cablink"-
Welcome to the JavaRanch! Please adjust your displayed name to meet the
JavaRanch Naming Policy.
You can change it
here.
Thanks! and welcome to the JavaRanch!
Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
 
subject: a locking question