• 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
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

locking a record

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you share your knowledge about this issue with me. I failed my Developer Certification because of that.
Thanks a lot
 
Bartender
Posts: 1872
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Pep,
Welcome to this forum.

Can you share your knowledge about this issue with me. I failed my Developer Certification because of that.


I am sorry to hear you failed.
Locking is a broad subject, there are different possible requirements depending on the assignment you received, as there are multiple valid soutions.
So would it possible for you to post the locking requirements quoted from your instructions and explain briefly what you did to fulfil them ?
It will then be easier to enter in a - hopefully - useful discussion.
Best,
Phil.
 
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Pep,
Don't worry, you'll be fine next time. You are not alone.
As Phil said, try to start this topic yourself on a particular aspect of locking.
Cheer up,
Adrian
 
Pep Menval
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Adrian Muscalu:
Pep,
Don't worry, you'll be fine next time. You are not alone.
As Phil said, try to start this topic yourself on a particular aspect of locking.
Cheer up,
Adrian

 
Pep Menval
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot, talking to you do cheer me up. Anyway, my assignment is Fly By Night Services, and people at SUN discounted 30 point out of 30 because my lock method should block instead o throwing an controlled Exception. I send some messages to them by the response was resubmission. Unfair I think, I just needed 12 point to pass.
Is there anyone who did this assignment before or someone who can help me about it.
Best
Pep
 
author and jackaroo
Posts: 12200
280
Mac IntelliJ IDE Firefox Browser Oracle C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Pep,
We will be glad to help you with your locking code.
Perhaps you could start by telling us your design decision for why you chose to throw an exception rather than blocking as required in the instructions?
Regards, Andrew
 
Pep Menval
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Andrew Monkhouse:
Hi Pep,
We will be glad to help you with your locking code.
Perhaps you could start by telling us your design decision for why you chose to throw an exception rather than blocking as required in the instructions?
Regards, Andrew



Just in case a thread would block too long or hang up. Obviously I made a great mistake. I'm looking in the forum for an answer.
Regards, Pep
 
Philippe Maquet
Bartender
Posts: 1872
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Pep,
I initiated a thread which could interest you : Single table / Simple Locking - WeakHashMap vs WeakReferences.
That thread quickly slips into a discussion about map's semantics between Max and Jim, but I still think you should find the basics out there.
I guess you'll be resubmiting soon, and I am - as Andrew and most of people on this forum are - willing to help you pass.
So don't hesitate to post questions !
Best,
Phil.
 
Andrew Monkhouse
author and jackaroo
Posts: 12200
280
Mac IntelliJ IDE Firefox Browser Oracle C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Pep,
The basic answer comes from the instructions:

Extending suncertify.Data:
The lock method should block until the requested lock can be applied.


So Sun expect the lock method to call wait() if someone else has already locked the record you want, and the unlock() method should call notifyAll() to ensure that waiting clients get another chance to try and lock the record.
By the way, are you tracking ownership of the locks (to ensure that only the person who has locked the record may unlock it)?
Regards, Andrew
[ November 01, 2003: Message edited by: Andrew Monkhouse ]
 
Adrian Muscalu
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well said Andrew, in this case the specs are clear. The implementation requires to wait.
Pep, good luck with it.
Adrian
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic