Torsten M�ller

Greenhorn
+ Follow
since Oct 06, 2005
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Torsten M�ller

Hi,

I've a maybe stupid question on deadlocks.
At the moment I realized the locking-mechanism like this:
while: is record lock? -> wait
when unlocking: -> nofify all
normally this should work without deadlock, BUT: what about any client has been just turned off?
In this case the lock remains(?) and the thread won't become awake during the notifyall.
Do I have to handle such situations? There are several situations which can happen, beginning from computershutdown going to memory-failures.
I think I don't have to, what do you think?

Greetings

Torsten
Hi there,

sometimes I wonder if anyone gets through the javadeveloper exam without questions
The more often I read the task, the more questions I get, I hope you could help me solving them.

All questions belong to "Bodgitt and Scarper".

a) "The operating mode is selected using the single command line argument that is permitted. Architecturally, this mode must use the database and GUI from the networked form, but must not use the network server code at all."

My problem is the part "but must not use the network server code". I've decided to use RMI, so I HAVE to reuse some code of the server. Or is this just a misunderstanding. The server has about 10 lines, it creates an object, registers it to the rmiregistry and finishes. Is the server in the statement of Sun this 10-line-server or the 10-line-server together with the object created?

b) "It must be composed exclusively with components from the Java Foundation Classes (Swing components)."
I used own classes like MyButton (extended from JButton). These components are setting the color and other small points, so I don't have to add lines like buttononethousandfiftyone.setBackgoundColor(whitegreenglowing) EVERY time using a button (all buttons should have the same color). I think this button still counts to the Swing components, because it extends JButton, am I correct?

c) "Your user interface should be designed with the expectation of future functionality enhancements, and it should establish a framework that will support this with minimal disruption to the users when this occurs."
What do they think when writing "framework"? I've implemented all of my code dynamicly, so additional fields in the database will automatically add new rows to the JTable, searchinputfields and so on, but I wouldn't call this a framework. Is there some hint what they are thinking of?

d) "the current thread gives up the CPU and consumes no CPU cycles until the record is unlocked."
Do they really mean NO cpu cycles? Till now I implemented something like this:
synchronized (o) {
while (data.isLocked(recNo)) {
o.wait();
}}
using this and a o.notify() at the end of the unlock-method, I alway wake up one waiting thread, BUT possibly it's the wrong one, so it might be (if there are two waiting threads for two different recordnumbers) one thread will consume a minimal amount of cpucyles (data.isLocked) and then wait again.
Is this allowed?

e) My code (d)) MAY be a deadlock if one client crashes the moment he has the lock but didn't release it, the lock will not be removed automatically. Do I have to run a watchdog releasing the locks after some time?

f) The given interface throws a DuplicateKeyException on creating a new record.
But.... CAN this happen? This would mean you have to check all the database to the given data if this is already inserted. In my oppinion douplicate data MAY happen, e.g. if someone gives the order to paint his house and he whants to have a different bill for the roof and floor. The name, task and so on would be the same. So where does this exception come from? Simply implement this interface but never throw it and just documentating this to the choices.txt?

g) "It must allow the user to book a selected record, updating the database file accordingly."
Possibly a point for first INTENSIVLY read and then programm... Do I have to provide a simple button "book" and it enters something to the record-field "owner"? At the moment I have a button "edit" where you can change all fields, this should do the same job, doesn't it?


Sorry for bothering you with all these questions, but I hope you could help me a little bit :/

Greetings

Torsten
Thank you for your replies, today I got access to the task, and it says:

"You are permitted to use any IDE tool you choose, but you must not submit any code that is not your own work."

so it answers my question already
Hi,

I'm going to try the scjd and hope you can give me some help with a very very stupid question.
Sun writes:

The following APIs and facilities may not be used:
[...]
* Third party software libraries or tools (such as browsers)

How do I have to read this? Mustn't I use a browser for develpment, or just for the presentation to the user (like html-pages)?
Background for this question is an statement of a person: "We are going to train using a plain text editor, not eclipsem, because you are forbidden to use eclipse for the scjd." I think this statement is absolutely nonsense, because how should sun know where I entered my code?

I'm not a friend of typing all the code in such tools like emacs or vi because the autocompletion of eclipse saves much time....

Does anyone know anything about this?

Greetings

Torsten
Hi,

first of all, please don't hit me for this question
I just noticed everyone one I know who passed the 1.4 has a score of >80%, noone failed. But for the 1.5 I don't know anyone having >70% the all have <70% or failed the first time.

Does anyone know if this is by chance or if this is the normal?

Please don't misunderstand, I don't say persons who passed 1.4 don't know Java, I just think the 1.5-test is too hard.
Or is it just because you don't use the new 1.5-elements in allday-buisness? I never used generics or such things before learning for the scjp.

How do you think about this?

Torsten
Hi there,

yesterday I passed my SCJP-exam (Java 5.0). Ok only 65% but I think passed means passed.
I just wanted to drop this site a big thank you, because things like the Rules Roundup Game gave a little bit of fun to the hard learning lessons.
so:

THANK YOU


Greetings

Torsten
[ October 06, 2005: Message edited by: Torsten M�ller ]
19 years ago