Forums Register Login

Need help on the locking part

+Pie Number of slices to send: Send
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 Data.java 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 Data.java and use it's methods.
This is just fine if my Data.java class is only on the server, but if it is on each of the user's computer, then there's an instance of the Data.java 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.
+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
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 ]
You can't have everything. Where would you put it?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 738 times.
Similar Threads
B&S: database design..please review
B&S Database Access Design
FBNS: Did anyone use a singleton Data.java with RMI?
NX: Adapter class
Design
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 23:55:45.