my dog learned polymorphism
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Need help on the locking part Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Need help on the locking part" Watch "Need help on the locking part" New topic

Need help on the locking part

Ahji Thameur

Joined: Jan 31, 2008
Posts: 3
Hi guys,

I am not so experienced with java, I just managed to pass SCJP in december with lots of hard work and studying.
I would really appreciate your help.

My preparation for the SCJD exam was a meticilous reading of Thinking in Java,but I don't how to implement the locking access to the .db file.

I figured I should apply the Singleton Pattern to the class, synchronize all of it's methods and then create a new thread for each of the user's requests. These threads, get the single instance of and use it's methods.
This is just fine if my class is only on the server, but if it is on each of the user's computer, then there's an instance of the for each user, and they could make a mess of the .db file.

Do i need to worry about this in order to pass this exam?
If yes, could you please point me to the appropriate study materials?
I see that you guys are talking about a Lock manager and other threading concepts and patterns, an I am ashamed to say I have no idea what you talking about.
Musab Al-Rawi
Ranch Hand

Joined: Aug 06, 2007
Posts: 231
the book that I found so powerful, organized and definitely useful is The Sun Certified Java Developer Exam with J2SE 5, Second Edition by Andrew Monkhouse, Terry Camerlengo.
It covers Locking and GUI and many over topics.

rohan tiwari
Ranch Hand

Joined: Sep 13, 2007
Posts: 82
Thinking in Java is a good book,I have also gone through it once.

Try to synchronize only a minimum amount of code as synchronized code is effectively exclusive.
Have a look in Andrew Monkhouse`s book , it is very good.
[ February 02, 2008: Message edited by: rohan tiwari ]

I agree. Here's the link:
subject: Need help on the locking part
It's not a secret anymore!