Help coderanch get a
new server
by contributing to the fundraiser
  • 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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

SCJD score question

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I received my SCJD score this week (passed with a score of 354/400):

General Considerations (maximum = 100): 99
Documentation (maximum = 70): 70
O-O Design (maximum = 30): 30
GUI (maximum = 40): 31
Locking (maximum = 80): 44
Data store (maximum = 40): 40
Network server (maximum = 40): 40

I am somewhat disappointed because I don't think I missed anything with my locking approach. Can someone help me find out? Is it possible the assessor made a mistake?

Here is how I implemented locking on the client side:

a) lock the record and get a lock cookie
c) read the record and ensure it is not booked
d) book the record using the lock cookie
e) unlock the record using the lock cookie

Server has a class that manages record locks using a HashMap<Long, Long> such that only one client can have a lock to a record at any given time.

lock (record number):
a) wait if the record is already locked
b) generate a random number for the lock cookie
c) add to the hash map with record number and lock cookie
d) return the lock cookie

unlock (record number, lock cookie):
a) check if the record is currently locked. if not, return
b) verify that the lock cookie matches the cookie in the hash map for this record. if not, throw a security exception
c) remove the record number entry from the hash map
d) notify others waiting on this record

I would appreciate any pointers you can provide. Thank you.
 
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
You might want to look at The Mysterious 44/80 Locking score.

Regards, Andrew
 
Sagar Salapaka
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Andrew, I /do/ check if the record is already booked [and throw RecordNotFoundException] after locking. And since all updates to the database go through this lock/unlock sequence, I am still not sure why I got dinged.
 
Sagar Salapaka
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I sent an email to Sun regarding this. Here is the response from Sun Certification Customer Support:


Thank you for contacting Sun Certification Customer Support. We apologize for our delay in responding to your inquiry.

Unfortunately, we do not review assignments that have passed. Both the SCJD assignment and SCEA assignment are essentially pass or fail because we do not release your score when verifying your certification status.

This pass or fail scoring is further emphasized with the new SCEA 5 assignment. You will only receive a numeric score for this assignment if you fail. Passing assignments are not given a score at all for the SCEA 5.

We have adopted this grading policy primarily because some employers had begun requesting the scores of certified candidates. While we do not release this information, we wanted to take additional steps to ensure that the score information was not being used as a hiring criteria.

We regret any inconvenience you may experience as a result of this issue.

Please let us know if we may be of further assistance.



I am over this now. I am posting it here for the benefit of anyone interested.
 
reply
    Bookmark Topic Watch Topic
  • New Topic