File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes DataBase Locking 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 "DataBase Locking" Watch "DataBase Locking" New topic
Author

DataBase Locking

Ramesh kumaar
Ranch Hand

Joined: Mar 19, 2002
Posts: 146
Hello All,
How to do database locking. What does it mean how to achive it.
-rameshkumar.
Ramesh kumaar
Ranch Hand

Joined: Mar 19, 2002
Posts: 146
Is there any one to help me.
-rameshkumar
Chiji Nwankwo
Ranch Hand

Joined: Jun 21, 2002
Posts: 56
Hi,
When your application is running in remote mode it has the potential to be accessed by more than 1 client, when this happens you would need to deal with concurrency issues. You will need a mechanism that controls access to sensitive data, the db.db file in this case. One of the ways in which this can be achieved is by using the wait and notify(All) methods declared in the Object class. The use of these methods needs to be accompanied by the use of the 'synchronized' keyword. We have been provided with empty lock and unlock methods, where you decide to put these methods and how you decide to implement them is a choice that you will have to make.
Some people have implemented these methods in the Data class and some have implemented them in a LockManager. I'm sure that there are other ways and places that they can be implemented, but these seem to be the most common ones.
I hope this helps you.
Regards,
Chiji


SCJP, SCJD, SCWCD<br />"Meekness is not weakness, but power under control"
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: DataBase Locking