This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

a locking question

 
Alex Gregory
Ranch Hand
Posts: 46
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2937
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 46
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 59
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Alex,
Can you say more about your locking?How can you solve it?I'm confuse about it.
Thank you
 
Mark Spritzler
ranger
Sheriff
Posts: 17276
6
IntelliJ IDE Mac Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"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
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic