• 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

Worried about automatic failure - do I have everything?

 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
After a long week I have finished my SCJD assignment (URLyBird 1.3.2) and have fulfilled all the must requirements as far as I know. In addition I've done basic testing to check that my database class implementation works - I can read records from the database, delete them (and subsequently reuse the record number and disk space), create new records, search them, and the locking/unlocking appears to work as well from my simple tests in which I try locking records from different threads and sleeping a few seconds before unlocking - if the record numbers are the same, then the runtime is approximately sleepTime * numThreads, but when the record numbers to lock are different the runtime is about sleepTime so clearly parallelism is at work.

In fact, I do not see how they can automatically test my database implementation because they don't know what the constructor signature of my Data class looks like. In fact, it takes in a custom type (DatabaseIO) so I doubt they can automate this. My spec says only

Your data access class must be called "Data.java", must be in a package called "suncertify.db", and must implement the following interface...

My guess is that they just run a reflection test to make sure that the provided interface hasn't been modified and that the checked exceptions have the required constructors and are in suncertify.db.

So functionality-wise, I feel safe. My GUI is minimalistic but supports the very basic find and book operations requested by the spec. I have generated an RMI stub for my class that implements Remote, and my JavaDoc is sufficient + has a nice class diagram. The majority of my thoughts and dilemmas are in choices.txt as well as reasons why I did not implement some extra features (for example, unbooking a reservation). I'll try some testing on other platforms as well just to make sure.

Does it look like I'm ready to submit?
Thanks!
 
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You also need the user guide.

You can also try adapting and using the ant build.xml file and verification utility found at https://coderanch.com/t/189448/Developer-Certification-SCJD/Assignment-submission-file-structure-verification
 
Cless Alvein
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reminder. I actually did write the guide as userguide.html so I will be sure to include that with my JAR.
 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Have you tested for concurrency problems in networking mode.
By example, when you perform a search on the GUI, you will use the DbAccess#find(), and then some DbAccess#read() to obtain the records corresponding to the record numbers found.
Do you ensure that, when you read the records, none have been updated by another network client since the time you found the record numbers corresponding to your search criterias. In case you have not checked that, it is possible that some records you read do not anymore correspond to your search criteria.

Marc
SCJP 5.0, SCBCD 5.0
 
Alecsandru Cocarla
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If he has the "starts with"/"exactly match" requirement, he probably checks for that anyway, since a record can't "exactly match" unless it "starts with"...
 
Cless Alvein
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My GUI allows the user to search for "exact matches" or for "prefix matches." It's true that in the former case, I do extra checking so that only exact matches are returned, but in the latter case I do no checking. However, I don't think that is too much of a concern in this case since the delay between find() and read() already presents a concurrency problem that we can't solve without implementing some atomic findAndRead() function at the database level. Either way, I don't see that as being an automatic failure.

On the topic of the suncertify.properties file, my program works fine if it does not exist, and regardless of whether it is found or not, the program prompts for the database file/server address/port (depending on the mode that the application's running in) and will save that to the suncertify.properties file so that it may be read in the future. The Properties class is very nice for this. Also, I am sure to re-prompt the user every time the program is started, and if the properties file exists, then I pre-populate the form fields but still display the prompt.

Hm.. my update() and delete() methods throw IllegalStateExceptions if the records aren't locked by the current thread, which seems good to me since the only other options are to acquire the lock inside of update() and delete(), which is bad because of the possibility of a long waiting time, or to return without doing anything, which is also bad since the user should be notified of a failure.

The rest is just packaging it as a JAR, which I will read very carefully.
 
Cless Alvein
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, I have 4-6 weeks to wait but I submitted my assignment and completed the essay exam today. The exam was easy in that I was able to write three to five paragraphs for each question and finished an hour early, but it was difficult because I had forgotten how I had written a lot of the code. So be sure to read over your code the night before! But overall I treated the exam as another choices.txt.

Thank you for the help and I will post my results to the Results forum when I get a reply from Sun!
 
What do you have in that there bucket? It wouldn't be a tiny ad by any chance ...
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic