• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to ensure no other application is accessing my DB when I am accessing it?  RSS feed

 
aryan Sharma
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i would be doing some operation with my DB. now mine is a JEE application and am using JPA. when i am dealing with my DB (or data), its quite possible that some other legacy application might also be manipulating the same data, since there are quite a few appliations accessing the same DB. Now i do not want the other application to access my data when i am dealing with it. How could i achieve this exclusive access so that no other application can possible corrupt my data.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are using a different user, you shouldn't have anything to worry about.
 
aryan Sharma
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
and what if they are the same user? how to proceed in this case?
 
Thiago Alves de Moraes
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Aryan,

You should use the optmistic or pessimistic locks for hadling concurrent access.

Take a look at those locks and choose the best solution for your system!
 
aryan Sharma
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
so having proper locking strategy should prevent such issues right?
 
Kumar Raja
Ranch Hand
Posts: 548
2
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
aryan Sharma wrote:so having proper locking strategy should prevent such issues right?


That is the basic idea of using proper locking mechanism. Are you facing any issues with that ?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!