Ulas Onder

Greenhorn
+ Follow
since Mar 15, 2004
Merit badge: grant badges
For More
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 Ulas Onder

Hello all,
Finally, i've got my EJB certification. I want to thank to Kathy & Bert for their book. What 'Matrix' for Holywood is what 'Head First EJB' for IT world is, i think
Ulas Onder
SCJD, SCBCD, SCWCD, SCJP
19 years ago
Hi guys,
Thanks for answering my question about locking, although i've got a famous 44 out of 80 for it, i'm a SCJD from today on
Score: 351
General Considerations (maximum = 100): 97 Documentation (maximum = 70): 69 O-O Design (maximum = 30): 30 GUI (maximum = 40): 31 Locking (maximum = 80): 44 Data store (maximum = 40): 40 Network server (maximum = 40): 40
I thank to all contributors of this site, long live JavaRanch!
Ulas Onder
SCJD, SCWCD, SCJP
19 years ago
Thanks guys,
I put only a part of the delete method, it throws a RNFE, but not in the section i've posted.
Ulas Onder
SCJP, SCWCD
Hi guys,
I read a lot about the locking problem from previous topics, but i could not find the answer to my problem.
Below is the DBMain interface from my instructons:

Below is my solution foor lock/isLocked/unlock and delete methods. (In delete method, i have bypassed the unlock method because once the record is deleted, unlock method throws an exception.)

I'm aware that my solution is a little bit strange, but i could not think of another way because of 'RecordNotFoundException' thrown from each method. I could have written the code like this in order to fit in this locking contract. Do you have any idea that my code is acceptable or not?
Have you thought of a similar approach?
Ulas Onder
SCJP, SCWCD
[Andrew: removed islocked() and unlock() methods]
[ March 15, 2004: Message edited by: Andrew Monkhouse ]