• 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

NX: Exam review (URLyBird 1.1.2) !!!

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Has anybody claimed for an exam review?
My assignment was scored as failed with the following score:
General Considerations (maximum = 100): 94
Documentation (maximum = 70): 70
O-O Design (maximum = 30): 30
GUI (maximum = 40): 28
Locking (maximum = 80): 0 !!!
Data store (maximum = 40): 40
Network server (maximum = 40): 40
Locking was the problem, but I tested it quite well before submition, using JUnit, different users, manual locking, so I'm pretty confident with it.
I guess it failed the automatic checking because my Data class had no default constructor (requirements didn't ask for it, but I know believe I've been a bit na�ve following the requirements strictly!!!)
As far as I am convinced that a requirement is missing and the automatic checker is not checking what the requirements are really asking for, I'm trying to claim Sun for a manual review.
Until now I've not been successful, sending emails to Sun, Prometric etc... There is nobody behind the line (3 weeks since first try)! My Sun representative is also desperate and its only solution is to pay me another voucher. As you would expect, this is not the solution I'm expecting.
Has anybody experienced a similar problem? Is there a way to have the assignment reviewed by Sun in a professional way?
Thanx everybody!
 
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ouch, that's harsh. Do you have any indication that the problem was the lack of a default contructor, or was that just a guess? If if really is the constructor that's the problem, I'd raise hell over it. They have no business knocking off 80 points for something they didn't document. But there's also a chance that the problem is something else. Perhaps you misunderstood something in the requirements? In that case it doesn't matter how much you tested - your misunderstanding is probably built into the tests too, so they just reinforce the problem.
My Sun representative is also desperate and its only solution is to pay me another voucher.
Well, if the problem is really something trivial like adding a no-arg constructor, maybe you should take this offer and make the change. They're still in the wrong, IMO, but it might be easier than further argument.
 
Ranch Hand
Posts: 555
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Gael ,
... it is sad...
I personally don't beleive the problem is Data() C-tor. There are some people who made extra work with time-outs (to avoid dead Lock) throwing own exception etc and they have had problems. Have exatly done what was required? Have you done any additional Locking functuanility?
One member of this group, Pete, has a also problem with Locking (but he got at least some point for it), he appealed and it was accepted by SUN!
Before, appealing I would try to analyze what U have could done improperly.

Regards,
Vlad
 
pepito grillo
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Jim,
Thank you very much for your time.
This is exactly how I feel. Anyhow, I'm still a bit worried about the fact that I didn't receive any explanation about the failure, so I can't be sure about what was wrong and how I should correct it. Moreover, I'm not very happy with seeing in the future a failure in my test history, specially when I believe my assignment was more than correct.
Note: before submition I asked some colleagues to read the requirements (trying not to influence their thought) and test by themselves the solution. They all agreed the solution was great, so it reinforced my conviction that I shouldn't fail the exam. ;(
The constructor issue is a guess of my own. I wondered how - as an examinator - I could score 0/80 without providing further explanations.
Theoretically, a major justification for the exam fee is the time required for its evaluation, and it is never bad to demonstrate that you have done your work...
Anyway, the fact that the requirements ask you to code a class that must implement a specific interface, in a specified package makes me think it has been done to plug the package into a tester application. Unfortunately reqs didn't say a word about the constructor, and even if now I believe it is obvious that the constructor sould be the default one, it is not in the requirements and should be corrected.
Gael
 
pepito grillo
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Vlad,
Thanx very much for responding.
Why do you believe it is not a problem with the constructor?
Gael
 
Vlad Rabkin
Ranch Hand
Posts: 555
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Gael,
First I really agree with you that you have aright to know why you failed. So, I would try to get explanation: at least if not to appeal, but not to repeat it next time!
It is jus unfair...
Second, why should be a Data() the problem?
Your Data class must have opportunity to work with the file, either it needs File object, or filename (as I did). It means that somehow you have to pass these data there.
- default Constrctor and appropriate set method
- your own Constructor
, but it is your own decision.
I don't know exactly what C-tor for Data do you have at the moment: it cen be that you have there a LockManager Object in addition to file. (That can be possible a problem, because they do not want us to use locking for standalone mode, so Data should not contain any locks, it is a part of Remote Implementation class). If you have this additional argument it cause probably to lost of some scores, but
I don't beleive it can cause you to lose all 80 points !
Have you tried to establish your own time-outs for locks, or use Unreferenced Interface or some tricks to avoid dead-locks???
Vlad
 
Vlad Rabkin
Ranch Hand
Posts: 555
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Gael,
I can see that you hot 100% for GUI Client.
I have almost the assignement. I am not sure if I have to implement logic that user should get only rooms available for the last 48 hours (in background description of assignement).
Have implemented any logic in regards of 48Hours booking?
Thankx,
Vlad
 
pepito grillo
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Vlad,
Well, as far as my understanding goes, you score something 0 / 80 when something just does not work at all, the design is completely wrong. But this is not the case. As far as I did many tests before submition, I'm sure this is not the problem. So, to me, the explanation for a 0 / 80 is that the program didn't even pass an automated test, and the examiner didnt spend a second with it...
From the technical point of view, the Data class uses a constructor that accepts custom public class that . The Data class has no synchronized method. synchronization is done at record level to allow some level of concurrency, and as synchornized blocks for atomicity in some composed cases (I use a cache for reading dirty records), so it doesn't requires an external lock manager. Regarding time-outs, I have not implemented it, but have documented the resulting design weakness and explained how it could have been solved.
I have real experience in enterprise-class design so i'm used to do this kind of job...

I spoke to my Sun representative here in Spain and she told me that Sun doesn't allow exam revievews!
Is that possible? What about Peter and others? Damn, I'm starting to think that we, europeans, are second class customers
Any thoughts?
Gael
 
pepito grillo
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Vlad,
In fact just 28/40. Anyway, my consideration for the 48 hours booking was not to prohibit bookings (The client locla time can be wrong or in a different international hour zone. The 48h restriction should be checked at least in the server side), but to warn the user before booking in case that the 48h timeframe is not respected, asking him if he wants to abort booking.
Gael
 
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 Gael

I spoke to my Sun representative here in Spain and she told me that Sun doesn't allow exam revievews!


Your representative may just be stating the official policy without checking what can be done. If your representive, like mine, works primarily in the sales department, then they may not know what is possible. And unfortunately your representative may not wish to try and do anything for you (unlike mine - I have been lucky to get a really helpful rep).
If I were you, I would contact Sun through the email address in your instructions file. Give them enough details so that they can look up your file, and ask them to either review your case, or to provide you with the examiner's comments on why they chose to give you zero marks.
Regards, Andrew
 
Vlad Rabkin
Ranch Hand
Posts: 555
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Gael,
Thanx for your reply.
Take a look at the following thread:
https://coderanch.com/t/183626/java-developer-SCJD/certification/SJCD-failure
He has successfully appealed!
Vlad
 
Bartender
Posts: 1872
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Gael,
IMO, you did not fail because of such an "automatic failure". In my instructions.html, I can read in section "How The Assignment is Marked" :


The marking is done in three phases. First, software checks that overall structure and nomenclature conform to specification. Second the examiner runs the code ensuring that it functions correctly through the specified operations. If any automatic failures are noted at this stage, the marking process terminates and the assignment is failed.


As you got 94/100 for general considerations and 28/40 for the GUI part, it does mean that you passed the software test. Right ?
In your position, I wouldn't accept a new voucher for free. SCJDis so much work and personal investment that I don't think that being granted to do it once more for free is a fair compensation in case you were graded unfairly.
I am surprised they didn't give you any clue about why you lost all locking points : Pete - who won an appeal - got this comment :

Server (maximum = 53): 23
Major point loss for record-locking mechanism. Operation is fine when trying to lock a record that is already locked. But when trying to lock a single record at a time when the entire data base is globally locked, the code throws an exception rather than blocking.


(See this thread.
I agree with Andrew when he writes :

If I were you, I would contact Sun through the email address in your instructions file. Give them enough details so that they can look up your file, and ask them to either review your case, or to provide you with the examiner's comments on why they chose to give you zero marks.


In my instructions, that address is : who2contact@sun.com.
There are many different versions of the assignment and you are quite vague about your locking implementation.
So I have a win-win proposal to you :
  • you give us all excerpts from your instructions regarding locking
  • you give us a short description of your locking implementation
  • we - I'll be in the team but I've noticed there is much team spirit here at JavaRanch - will try to give you arguments to defend your choices, or at least give you clues to help you to avoid the same errors if you fail in the appeal and decide to try again.


  • It's a win-win proposal because there are probably people here who are going to fail in locking and who wouldn't if they knew why you did.
    Good luck anyway and don't drop it !
    Cheers,
    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
    Gael,
    Just to give you some hope for appeal. Here are some more posts from people who sucessfully appealed:
    Sun re-entered my score, Passed with 149/155
    I Failed SCJD , Help Me
    And one from someone who pestered Sun until he found out why he was failed: Failed In SJDC, Have no Idea what was wrong
    Regards, Andrew
     
    pepito grillo
    Greenhorn
    Posts: 8
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Well, I'd like to thank everybody for the interest.
    I think you are probably right when you say that the problem is not at the software test. So yes, it is more likelly in the code itself.
    Here are some clues of what I did (following Philippe schema):
    1. instructions regarding locking (extracted from instructions)

    Locking
    Your server must be capable of handling multiple concurrent requests, and as part of this capability, must provide locking functionality as specified in the interface provided above. You may assume that at any moment, at most one program is accessing the database file; therefore your locking system only needs to be concerned with multiple concurrent clients of your server. Any attempt to lock a resource that is already locked should cause the current thread to give up the CPU, consuming no CPU cycles until the desired resource becomes available.
    2. short description of your locking implementation
    ROUGHTLY: The Data class works as a singleton pattern, accepting concurrent requests (no synch methods). I provided a class called DataTable responsible for handling records. This same class chooses in its constructor to work with or without a synchronized HashMap internally. In fact two objects of this class are created as Data data members; the first one is used to store every record for read-only operations (dirty readings) and the other one to work with locked records. These 2 objects are members of the one and only Data instance. When I said that some synchronized blocks are used, I was thinking about blocks used to copy/clone data between these 2 tables, and updating info to file. Anyhow, record locking is done at record level (wrapped by a RecordHolder class) where the target record instance knows who is holding it - using a lock cookie specified by the DB interface provided by the instructions, forcing other incoming requests to wait until notified when the record gets unlocked.
    Here are some code exerpts:
    Data class:

    RecordHolder class:


    I sincerly hope that there is a mistake here you could discover justifying my score, and if not, at least that this could be of help for others (even bad examples are instructive ). If you need more details, just let me know.
    Thank you all again,
    Gael
     
    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 Gael,
    After writing, I pushed the logic a step further : as you passed the software test, you've been graded by a human. And I immediately thought : it should be good news for Gael.
    Because you wrote :

    Locking was the problem, but I tested it quite well before submition, using JUnit, different users, manual locking, so I'm pretty confident with it.


    and I'm myself pretty confident with what you write.
    Now those human Sun's graders shouldn't be more crual than you and me are. So, if your locking scheme works, even in the hypothetical case it would be foolish, stupid and badly documented (BTW documentation is graded separately), it should still merit some points IMHO. In other words, 0/80 is not bad, it's worst than bad, it's nothing.
    So in your place, I would spam their email till I know why I failed in locking. The only risk you would take is getting SCJD.
    Now I just read your code. Your design seems weird to me. Why two HashTables ? A record is locked or not. So one of them seems to be overhead. What were your intentions ?
    Unfortunately, it's quite difficult to me to get an opinon from the excerpts you sent, because each time you call some "hidden" method I ask myself : "What happens within it ? Is it properly synchronized ? ... ?"
    Cheers,
    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 Gael
    I do not think you can guarantee that your cookie is going to be unique. From the API for currentTimeMillis:

    Note that while the unit of time of the return value is a millisecond, the granularity of the value depends on the underlying operating system and may be larger. For example, many operating systems measure time in units of tens of milliseconds.


    So it is possible that if the granularity of the time provided by the OS was larger than the amount of time required to lock two records, then the same value could be returned for each.
    However having said that - my instructions don't state that the cookie has to be unique. Obviously though it would be preferable.
    When I initially read your code, it appeared that more than one client could obtain the same lock. It took several more readings before I accepted that the place I thought was problematic (RecordHolder's lock() method) was probably OK. This is possibly the most likely explanation for the failure: if the examiner on initial reading your code felt that there was the possibility of a lock being acquired by more than one client then they would have failed you. Remember that the examiner doesnt have to prove that your code will fail - they just have to believe that there is the possibility of failure.
    Actually I am still not 100% convinced that two clients cannot obtain a record lock. If you have two client's call Data.lock() at the same time for a record that is currently not in your workingTable, then they will both get an instance of the RecordHolder from the readingTable, then one after the other they will call workingTables' addCloneAndLock() method. Does this code properly handle getting the same record to clone a second time? If not, then you have a problem.
    There is the following comment in FBNS and UrlyBird: "A clear design, such as will be readily understood by junior programmers, will be preferred to a complex one". Unfortunately I think that your design is overly complex, and I cannot see the advantages of it.
    Regards, Andrew
     
    pepito grillo
    Greenhorn
    Posts: 8
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Hi guys,
    Thank you very much for your reviews, since it put some light on what can have happened.
    The underlying design idea was to provide a reading cache, granting atomic readings (that's why there are a "reading" and a "working" table). When I say atomic readings, I mean that you can not read registers being modified. Why did I decided to do that in that way? Because I wanted to highlight the fact that most of the requests handled by the server are query-related, and reading stress have to be taken into account in a server design too... But I now see that I should have gone with a simpler design rather than adding complexity and error probabilities. :roll:
    Let me check how I implemented the "addCloneAndLock" (I'm not in the office today and can see the code) and send it to you FYI, since when I see it now I have the same doubts you have. Maybe the grader could have helped here and shared its doubts with us...
    Anyway, thanks to you, I can imagine what the evaluator could have thought. However, I will still try to push Sun to try to get THEIR observations. I still don't see clearly how they grade the locking mechanism (is there something between 0 an 80?).
    Thank you again guys. I wonder why I didn't heard about Javaranch before my submition, even if I'm tyhe kind of person that likes to learn from his own experiences :roll:
    Gael
     
    Ranch Hand
    Posts: 64
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Hi All:
    My assignment is URLyBird 1.2.1, which has been submited for scoring. Since I'm still awaiting the results, the Data c-tor issue interests me. I used a getInstance method to create the Data object, and the getInstance method takes an arguement -- database path.
    This raises the question of how Sun inspector's test the code. Since there are no requirements in the instructions about how to create the Data object, it appears the inspector might write a somewhat custom driver. And they might examine the code in enough detail to figure out how to write it!
    I think if I had it to do over, I'd include a static no-arguement getInstance for the purpose of the test using a hardcoded database path (the database is required to be at application root according to the instructions).
    The wait for review will now seem much longer ...
    Tx
     
    Ranch Hand
    Posts: 697
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Hello Guys,
    I'm a bit worried on seeing this thread. I'm not implementing any constructors for any class. Is this a problem? I mean, I don't find the reason why we should implement it/or not, so I left it as there are no requirements to do so. Are the constructors must in each class?
    Please comment on the design:
    I'm using a static block of code in the adapter class. This instantiates a Data class to read the existing records and deleted records into static variables. And all requests to Data goes through adapter. So whenever the first client performs a operation, at that time only the static block of code in the adapter runs and performs the operation. I thought it was OK. But as I read this thread, I got a doubt that if two clients executes a function at the same time i.e. first requests to adapter, then if before first thread populate existing records and deleted records there is a chanace that second thread might try to do something and throws exception. Is'nt that right? So I think my static block logic to initialize is not a very good idea.
    [Edited later on...] Or I can instantiate a adapter class myself when the application starts so that static block is first called by me only, and let records initialize. This is also OK, I think.[/Edited]
    Or is it ok if I do in the following manner. Once the application starts, depending on the mode selected, I will call a static initializeRecords() method in the adapter which instantiates a Data object and populates the records into static variables. I am sure this will work, atleast. Any comments?
    Really appreciate your thoughts. Thanks.
    [ February 29, 2004: Message edited by: Satish Avadhanam ]
     
    With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    reply
      Bookmark Topic Watch Topic
    • New Topic