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

Passed SCJD with 339/400

 
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:
Thanks to the great community at JavaRanch for making the Developer assignment fun! Special thanks to Max for the interesting and thoughtful discussions -- and the helpful softcover! For those who are interested, my results for the uRLyBird assignment were:


I offer these comments on design issues that have been discussed in this group:
1. Remote Object: My design had a single RMI remote object.
2. Datbase access: My design had a single RandomAccessFile/FileChannel that was shared by all threads and persisted for the life of the application.
3. Server Shutdown: I ignored the issue, but documented.
4. Logging: I used 1.4 logging.
5. MVC: I used an MVC architecture that avoided listeners.
What did I screw up with locking? Not sure. I used a lock manager collection and a specialized lock with acquire/release and timeout. However, I used a cookie scheme that permitted cookie sharing for multiple record operations; i.e., I permitted multiple record delete. I also permitted non-unique cookies. Furthermore, I synchronized all record read/write operations for data consistency. One of those choices probably did me in. Those who have read my previous posts probably can guess that I still think my design decisions were correct. Oh well ...
Thanks Everyone,
The latest SCJD
 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Congrates Bob!
Your posting will be very useful for the community.
What do you mean by having a LockManager Collection?
is that you had a LockManager class which had a collection for holding the locks and cookies?
thanks,
SB
 
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
Congrats Bob. I am going to move this to the appropriate Certification Results forum.
Mark
 
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
Congratulations Bob
Regards, Andrew
 
Ranch Hand
Posts: 1327
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I didnt implement a lockmanager and timeout functionalities but I got full marks for my locking part.
 
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 Bob,
Congratulations!
I have two questions:
1. DB Interface: have you extended DB interface to provide getSchema/getMetaData method for the client or did you hard coded length of field and so on on the client?
2. if 1. is Yes, have provided appropriate search methods(with exact search instead of prefix one) on the server or have done it client?
3. Have handled booking only in last 48 hours ... If yes on client or server and how?
Many thanx,
Vlad
 
Bob Reeves
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:
Thanks everyone for their well wishes! Let me provide some answers to the questions raised:
SB:

is that you had a LockManager class which had a collection for holding the locks and cookies?


The LockManager was a class that contained a Map holding my locks. I feel this is a solid approach and am appealing the score assigned.
Vlad:


1. DB Interface: have you extended DB interface to provide getSchema/getMetaData method for the client or did you hard coded length of field and so on on the client?
2. if 1. is Yes, have provided appropriate search methods(with exact search instead of prefix one) on the server or have done it client?
3. Have handled booking only in last 48 hours ... If yes on client or server and how?


1. Well, yes and no. I had a data model for the record that I passed back to the client. This model had methods to get the number of fields, their names, and their lengths.
2. I addressed this by documentation: I provided prefix and exact search methods -- and noted that no range or other search type was implemented.
3. My instructions said the records were to be used in 48 hours. It didn't require anything to be done about records older than 48 hours. I just ignored the 48 hour comment.
4. My client was single threaded. I documented this fact conspicuously since it greatly impact user response time. User response thime wasn't a requirement for my assignment.
Hope this information helps!
Tx
 
Ranch Hand
Posts: 1011
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
congratulations to you!
 
town drunk
( and author)
Posts: 4118
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Nice
M
 
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Could it be that while examiner tested your app. (we don't know how they do that), your app. deadlocked or some other exc. poped-up?
I thought if app. gives any exc. examiner can downgrade.
For ex. I packed my app. 4 or 5 days before the upload and tested it periodically (so that i started hating it!!), and i had to make a few fixes before I was satisfied more or less. And on my last day, I found one IOExc. from property file in one deep corner of my gui and had to re-pack again. My point is that there always can be a chance that something went rough.
???
 
Bob Reeves
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 Svetlana:
Yes, it's always possible.
Deadlock is difficult to test since the threads have to line up closely. I used the concept of "ordered resource acquire" to avoid deadlock, and this technique is known to work. That is, work if correctly implemented
My RMI tests did throw an exception: server connection refused. This occured when running 20 threads for 100 iterations. I read that other posts in SCJD found this problem, and some noted that it's a flaw in Sun's implementation of RMI. I can't think of any special exceptions that the lock subsystem could throw though, even runtime exceptions.
Tx
 
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 Bob,

Well, yes and no


Well, I am afraid I don't really understand how you delivered
DataModel and exact search by not extending interface?
Either you used just a separate interface or some kind of observer pattern.
Can you specify these issue a bit more in detail?
Thanx,
Vlad
 
Bob Reeves
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 Vlad:
You asked how I delivered prefix and exact search.
I used the database specification that says a null termination is used for fields that are shorter than full field width. Thats is, for prefix search, I just sent a plain string as the query. For exact search, I appended a null termination at the end of the string. The query engine inspected the search string to decide which type of search to perform.
Hope that helps!
Tx
PS: In thinking about my results, I'd advise you not to add anything extra not required by the specification. Otherwise, you don't get any plus, but you might get a deduction for "unnecessary" complexity.
 
Billy Tsai
Ranch Hand
Posts: 1327
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is a method in the String API that can be used to perform search.
I think the reason u lost mark in locking is because of the unnecessary complexities.
 
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 Bob,
I guess you didn't understand my question.
I am concerned of the DB interface, not the way search is implemented.
You said::
1) you have getDataModel() method on the SERVER
2) you have additional search methods
a) original find() // prefix
b) second findExact or whatever it is called on the SERVER
YOu said you didn't extend DB interface.
How your client application gets DataModel object from the server, since it is not in DB interface, and you DIDN'T extend DB interface toprovide these method???
Tx,
Vlad
 
Bob Reeves
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 Vlad:
OK, I understand your concern.
My server contains a database object that implements DBAccess. The server itself doesn't implement DBAccess (i.e., a Facade Pattern). What the server returns to the client proxy is a record model, not the String [] defined in DBAccess. Specifically, the server has a method:
RecordModel readRecord(long recNo).
I don't have findPrefix and findExact search methods. I just have the
findByCriteria
 
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
Ok,
Tnax, Bob!
 
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 Bob,
I forgot to ask you the main question I am concerned about!
How did you handle IO/Remote Exception. They are not in signature
of menthods in DB interface. I wrap them all now in my own unchecked exception. Some people wraped them in RecordNotFound and DuplicateKeyException.
How have you done?
Vlad
 
Bob Reeves
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 Vlad:
My take on exception design is that it depends on how you want the client to handle them. I decided that I wanted the client to handle local/remote calls identically, thus I chained all server-side exceptions in the RemoteException.
My server itself didn't implement the Remote interface, but was wrapped in what I called RemoteServer, which did. The RemoteException went only from RemoteServer to my ClientProxy, where it was unchained and thrown to the client. Note: If you do it this way, you must consider how you want the actual RMI exceptions handled.
Some might take exception to this approach ...
Tx
 
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 Bob,
that is exactly what I do with RemoteExceptions,
but how did you handle IOException? There must be handled in local mode also, but they are not in the method signatures of DB interface, which we are not supposed to change.
As I said, I use now own unchecked Runtime exception, but it is a bit risky.
I just want to know how you did handle it.

Tx,
Vlad
 
It is difficult to free fools from the chains they revere - Voltaire. tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic