This week's book giveaway is in the Server-Side JavaScript and NodeJS forum.
We're giving away four copies of Micro Frontends in Action and have Michael Geers on-line!
See this thread for details.
Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!

Trym Moeller

Greenhorn
+ Follow
since Nov 25, 2003
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Trym Moeller

Terry Martinson:
The point break down, was as you said placed right after clicking the "detail" button at the SCJD element. I use the web site http://www.certmanager.net.
regards,
Trym.
16 years ago
Thanks everybody for answering my questions and keeping the developer forum alive - it is sure nice to discuss and read discussions about the assignments from SUN.
I have very fast ? (I took the essay exam thursday and found the following result today) received the result of the examination - wonder if these are correct.
General Considerations (maximum = 100): 96 Documentation (maximum = 70): 70 O-O Design (maximum = 30): 28 GUI (maximum = 40): 36 Locking (maximum = 80): 80 Data store (maximum = 40): 40 Network server (maximum = 40): 40
Regarding the discussion about the locking 44/80 points:
I have focused on the requirement "while waiting using no CPU cycles". This I have accomplished calling notify instead of notifyAll.
Best luck to comming SCJD.
Best regards Trym
[ February 02, 2004: Message edited by: Trym Moeller ]
16 years ago
Hi George
You cleared things up thanks. I agree with you about the simpler the better.
Regards, Trym
Ryan Tang: I have implemented the RemoteDatabase as you have delegating to the LocalDatabase.
George Marinkovich: And I don't see, what is wrong with this approach, can you please elaborate on this. Thanks in advance.
Regards, Trym
[ January 19, 2004: Message edited by: Trym Moeller ]
Hi
When implementing the DB interface I open a file in the constructor of the implementing class. To close this file I either need add a method to the interface (void exit() or only add the method on the implementing classs and then cast the interface to the implementing class to call it.
Do you think it's alright to add mthods to the interface?
Best regards Trym
Thanks.
I will stick to the nice way, just implementing the required interfaces and the book functionality in the gui and test as much as possible with junit.
\trym
Hi
I keep on dreaming up new functionality when deciding what to implement.
My assignment about accommondations, says that "I am commisioned to let the user generate a list of accommondations matching the users choice of name/location". But I imagine that for the application to be working I must also implement functionality to book and unbook an accommondation, to create, update and delete an accommondation (hotel manager job).
How much of this do you think is relevant to the assignment?
Best regards Trym
PS. any comments are appreciated.
Hi
I would suggest that your gui, doesn't know IOExceptions (which comes from your choice of database implementation (or SUN's) ;-), but only business exceptions. So catch your rmi exceptions handle them and if necessary throw relevant business exceptions. I don't know if this solves your problem, but maybe new ideas arise.
Best regards Trym
As you said "Each waiting thread will (in an undefined order) go through the while loop once more before continuing and so only be able to run if the record it is waiting for has been unlocked. Otherwise, the thread waits yet again." which I read as the thread is doing some work, unless it was the lucky thread which had its record unlocked. I am currently trying to make a lock on record level, but cannot find a way to handle this in all situations.
pseudo code:
Map aRecNo2LockCookieMap;// map from recNo to lockCookie
public long lock (recNo) {
boolean tryAgain = true;
while (tryAgain) {
Object lock = aRecNo2LockCookieMap.get(recNo);
if (lock != null) {
sync(lock) lock.wait();
}
// here another thread can get in//
sync(aRecNo2LockCookieMap) {
if (aRecNo2LockCookieMap.contains(recNo)) {
continue;
} else {
tryAgain = false;
aRecNo2LockCookieMap.put(recNo, lock != null ? lock : getUniqueLock());
}
}
}
}
public void unlock(recNo, lock) {
sync(aRecNo2LockCookieMap) {
Object lock = aRecNo2LockCookieMap.remove(recNo);
}
lock.nofify();
}
My assignment sayes to use no cpu when waiting to get the lock on a record.
It seems to my that your lock waits on the map instance in which case all waiting will have to figure out if their lock has been released, but only one will have a go - is that part of your assignment or has anyone considered it?
Best regards Trym