Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!

Rodrigo Uchoa

+ Follow
since Feb 12, 2008
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 Rodrigo Uchoa

Hi Stephan!

Thanks for the feedback. I didn't mention method references on purpose, just so it wouldn't be too much to grasp at once. But I do recall making a remark about it somewhere in the article

As for the link, you're absolutely right. Will do that.

3 years ago
My tiny contribution,

It introduces lambdas emphasising on how the Collections API benefits from it:
5 years ago
Same here. It's been two months already and no grade. When I took the SCEA exam it didn't take as much. I guess they're overflooded with exams to grade
Hey guys,

It's been 4 weeks since I took the essay and I was hoping I could see my result by this time. The problem is I'm getting a "You're not authorized" message when I try to login into

Anyone experiencing the same thing? I have an account since 2005, and even a couple of months ago when I started the assignment I logged in without any problems.
John was right about that finally block. I completely forgot about it.

What I don't like about my initial solution, is the fact that there are "business validations" happening in two different places. The service layer, or the data layer, should do both checks if the record is already booked and if it still exists (not deleted). Doing one check in one layer, and one check in another, just seems not right. But.. it works

Why firts try lock a registry, and later ask if already is booked?, this fail because you are throw a alreadyBookedException, so the unlock never is executed.

Use a try/finally block ( so always finaly block execute the unlock method) or first ask if the record are booked, and later try lock and avoid a lock/unlock over bookeds records!

What about this scenario?

If the two requests happen at almost the same time, they'll both get TRUE. One of them, the latter, will be waiting for the lock and then will overwrite the first one's update, since there's no checking inside the lock or update for an already locked record. So there should be some kind of locking before the thread asks for the availability of a record. Am I wrong?
Ok guys,

I'm starting to make sense out of this. One more thing though: While the lockRecord method's signature throws a RecordNotFoundException, it doest not throw any other exception indicating that the record is already booked.

What I can picture in my mind, is that the code to validate if the record is already booked will be in the service layer, while the validation for a deleted record will be inside the "Data" class itself. Something like:

Did I get this right? Doesn't look pretty.


Hey everyone,

I've read quite a bit of posts about locking, but none of them seem to address the same issue I'm thinking right now. Which is why I think I'm missing something related to this whole locking thing.

According to the instructions, if a thread (client) tries to lock an already locked record, it should wait (use of wait() method) until that record is unlocked (possibly forever until notifyAll(), no timeout) so it can proceed. But doesn't this mean the last thread will always overwrite the first one's update? When the better solution, would be to display a message to the last thread so it could try again?

Let's picture two users, John and Bill. They both want to book record number 6, and they highlight and hit the "book" button at almost the same time. If Bill was a bit faster, he would book the record successfully with his ID, while John's GUI would be waiting Bill's lock to end. But as soon as Bill was done, John would proceed his booking without ever realizing someone had booked that record already. And so, Bill's booking would be overwritten.

Is this really what the instructions want us to do?

Roel De Nijs wrote:Even in networked mode it is not necessary to push changes to all connected clients.


Your post got me thinking... Never crossed my mind to push changes to clients in networked mode, since they're all connected to the "same synchronized data". Are there any hints in the instructions that this might be necessary?
Well, that's a relief Syncing that offline data would be a mess.

Thank you!
Hey guys!

Do we have to deal with data sync if multiple clients are using the program in standalone mode? To me, if this would be a real software, this "standalone mode" requirement would not make much sense. If we let different CSR's have their own local database, how can information be the same for all of them?

Am I missing something?
Oracle replied last night. They told me to wait a couple days, but It seems they're gonna help me.
Hey guys,

I'm hoping someone have a little mercy. I have just paid prometric to have access to my assignment, and due to some internet error I was not able to download the database file. (there was a link to click and download it).

I got the URLyBird assignment, and I was wondering if any good soul could do the favor of sending me a copy of the file.

People at prometric said I should contact oracle directly regarding this matter, which I did, but I have not yet received any response from oracle.

Please, help!

rodrigouchoa at