Eric Janssens

Ranch Hand
+ Follow
since Sep 26, 2005
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Eric Janssens

My Data class does not prevent multiple locks because its contract define in my DBMain interface does not indicate that it is not possible. This can be completely different in your DBMain interface. For example, my DBMain interface has no cookie at all.

My philosophy had been to make my Data class as compatible with the spec. define in DBMain interface as possible. Why? Because it will be used by other company applications and I want an integration as smooth as possible (I am a little suspicious about the quality of the code in the company after seeing their in house DB file ).
If you forgot the role-playing aspect, let's say that the automatic program that will test your submission will surely use the DBMain interface to test your Data class thoroughly (Locking, Data Store, etc.)

I must add that my Data class implements a sub interface of DBMain to permit me to add few additional methods. Again it depends of your assignment. In mine I had no trouble to justify it.

Now for my application, it is not possible for a user to lock multiple records.

Ps: I do not want to validate any of your code since it is completely dependent of your DBMain interface + the MUSTs of your assignment. I do not want to make some random guess, and I do not want to make a second assignment . But I really hope that the few key ideas I give you in this post will help you to solve your problem.
[ May 09, 2007: Message edited by: Eric Janssens ]
14 years ago

Does that say loud enough that I should not worry about problem I mention in recent thread (link provided) that one client won't try to lock multiple records and creates deadlock..

If by Client you mean outside programs accessing the database via the Data interface, you do not need to be worried about them. But you can always mention in your doc that those clients must take into consideration possible deadlock scenario.

If by Client you mean your own concurrent clients of your own server. It is better of course to be sure that no multiple lock for the same client can occurs. You just need to be sure that there is no way a client can lock multiple records at the same time.

The Data class is just the common access the database shared by all the applications in the company. You do not need to put everything there. You can always prevent multiple locks for one client at any upper level in your application.
[ May 09, 2007: Message edited by: Eric Janssens ]
14 years ago
@Ken Boyd

I got the B&S assignment.

From my signature of the DBMain interface, it does not prevent multiple lock for the same user. My Data class does not prevent it since it can be used by an other program where a multiple lock on different records can exist. Of course if 2 or more programs are trying to lock multiple records at the same time, it can be deadly. I think it is the responsibility of the clients of Data to use it properly. (it can be a good idea to stipulate the possible deadlock problem in your doc)

But honestly, I did not focus too much on this aspect since I extend the locking mechanism of DBMain interface to permit the realization of few "must" of my own assignment. I believe that depending of the "must" you have for your assignment a 100% correct solution from someone else can become a 100% incorrect solution for you.
[ May 09, 2007: Message edited by: Eric Janssens ]
14 years ago
Today I had good news. I was trying to find my result since 6 weeks via the sun website without any success but after rereading the FAQ on javaranch, I find an interesting link which gives me already all the scores of my Cert! (

The maximum number of points is 400, to pass you need a score of 320.
Section Summary:
General Con: 100 92
Documentation: 70 70
OOD: 30 30
GUI: 40 29
Locking: 80 80
Data Store: 40 40
Network Server: 40 40
Total: 400 381

I am really happy since I have few perfect scores but I am a little sad also because it takes me a long time to make a nice framework for my GUI. I really think that I have done a good job. Next time I used it, I got nice results (less complexity, faster, modular, etc.) but the examiner does not seem to have the same view as me

Anyway, Thanks a lot for all the help I got from this forum. My only advice for the certification (if you can spare the time) is to try first by yourself without reading too much because it is just plain fun and you learn more. And who knows perhaps you can find better way to do it all by yourself.

This forum is so good to find new ideas about logistics, testing, etc.
Thanks again!

ps: I forgot to mention that my assignment was "Bodgitt and Scarpet"
[ May 08, 2007: Message edited by: Eric Janssens ]
14 years ago
I don't have any real trouble (apparently) but I am curious:

Why, after settings my remote object reference in my client to null, does my client and server continue to communicate actively?
In fact, it only stops when the remote object will be effectively clean on the server.

I am running the client and server on the same machine and I am using Eclipse and jre1.5.0_09 as environment.

My for the RMI server are:
System.setProperty("java.rmi.dgc.leaseValue", "10000");
System.setProperty("java.rmi.server.logCalls", "true");

The remote object is a dynamic proxy. (no rmic)

The log on the server side:

The reference to the remote object is set to null just after dummyMethod() call.
All other rmi references have been set to null long time ago. (Registry and Factory)
rmi.unreferenced.MyRemoteInterface is my define interface for RMI.
rmi.unreferenced.MyRemoteObject is the UnicastRemoteObject implementing it.
The last message is the result of the call to unreferenced() on the remote object.

Why so much activity on the log between the dummyMethod() call and the unreferenced() call ? (I can understand one but four )

ps: my aim is to better understand RMI for my SCJD implementation not to complain about anything. I will put my code latter if it is not a known behavior
[ October 28, 2006: Message edited by: Eric Janssens ]
14 years ago
Thanks Edwin Dalorzo, but it is not a use case. It is more like a class diagriam with an arrow from java.lang.object to java.rmi.servlet.RemoteObject with the name <extends> on it.

It really seems to be a class diagram but in a short form. not sure if it has the same name and if the rules are the same. (I am really not that fluent in UML)

I post here because without the Monkhouse book nobody can answer correctly
But if nobody have it, I will try to post a picture in few days.
[ October 24, 2006: Message edited by: Eric Janssens ]
For those who have the Monkhouse book,

why the <extends> relationships seem to point in the wrong direction in the figure 6-7 (page 175). And which kind of uml diagram type is it?

Except the class diagram, I dont use a lot uml diagrams.
Thanks for your help
Thank you very much !!!

As you have notice, my example is not very relevant but the main idea behind is "How to handle unexpected RuntimeException in a Swing application?".

unexpected = should never happen (programmation error OR unexpected system error)

You have perfectly answer to my question. Thanks again.
Sorry, but I fail to find any topic on this basic concept. Hope someone can point me in the right direction. Here is my problem:

I know the swing event are running in a special thread.

In the default mode, any RuntimeException which occurs in the swing thread is display in the console but the program continue to catch other swing events and run as if nothing important as occurs.

I have 2 questions:

1. How to set the program in a way that any swing RuntimeException stop the whole application?

2. How can I set an action before the stop of the whole application generate by the first method? (like a popup alert containing the error message and any release of lock, etc.)

Here is a little program as possible starting point for the discussion, keep in mind that we will make it as if it was a far bigger hierarchical gui application and that I am not aware of the fact that a division by 0 can lead to a RuntimeException.

(I know I can try / catch the exception in actionPerformed ... but I want that any RuntimeException, that I am not currently aware of or that I think should not happen, stop my application after having display a popup, log the error and/or do any other kind of action)

Thanks in advance for your help !
[ October 18, 2006: Message edited by: Eric Janssens ]
I had look the Collection and HashSet classes in the API but didnt take a look to the Set interface.

Thanks a lot!
15 years ago
I know why the last test fail (HashSet fail to see that it contains the object modified because it regroup first by hashcode during the initial add) but I dont know which principle(s) I am violating in this code.

I have few ideas but nothing sure.
Does the Collection classes are intended to be use only with immutable objects?

Sorry if this topic have already been address. It s hard to find a relevent topic with those keywords.

[ September 23, 2006: Message edited by: Eric Janssens ]
15 years ago
My bad, it is indeed in your book that I found the example p167 (and not 187 ).

Sorry if you have already discuss that topic in one of the previous chapters. I have skip chapter 3, chapter 4 and chapter 5 to go directly to RMI.

ps: when I am sleepy, I tend to see an 8 when there is only a 6. (Hypermetropia :roll: )
[ March 08, 2006: Message edited by: John Smith ]
I just add to the title the word properly to give more precision at the subject and perhaps have more reply to my topic
I am currently reading A&T SCJD5.0 book.

In the RMI chapter (I have skip ch3 to ch5), the 2 examples (p187) that focus on object serialization are closing ObjectXxxxStream AND FileXxxxStream.

Is it better to close all the stream one by one OR closing the "external" one is enough. (like in ObjectOuputStream description)

note for the authors: the first finally block cant see oos, the second finally block cant see ois and fis. (p187)
[ March 07, 2006: Message edited by: John Smith ]
I bought the Sybex book when it was the only available. I buy the K&B 5.0 in January. I made few mock exams and just pass my 5.0 certification this week. Trust me K&B 5.0 >>> Sybex 5.0 !!!

Sybex is just a quick update of the 1.4 version in which they didnt remove the old material ( all complex operators + precedence, etc. ) and put few new 5.0 sections which are not discuss enough and properly in the book.
My guess is that they just want the book out as soon as possible to attract as many people they can until an other book came out.

Even the old 1.4 topics are discuss in more detail in K&B. 346 pages for the programmer section of Sybex VS 800 pages from the programmer section of K&B.
And K&B doesnt contain any additionnal information. It is just aim to the exam.

If you can do it, just stop reading the Sybex book and buy the K&B 5.0 book immediately.

Only bad point for the K&B book is the mock exam on the CD. A lot of bugs inside and no drag and drop questions.
[ February 24, 2006: Message edited by: John Smith ]