• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

a locking question

 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 2937
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
reply
    Bookmark Topic Watch Topic
  • New Topic