• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

DataBase Locking

 
Ramesh kumaar
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,
How to do database locking. What does it mean how to achive it.
-rameshkumar.
 
Ramesh kumaar
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there any one to help me.
-rameshkumar
 
Chiji Nwankwo
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic