File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need help on the locking part

 
Ahji Thameur
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Musab Al-Rawi
Ranch Hand
Posts: 231
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 82
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic