Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Data Access problem

 
chiranjeevi gunturu
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

we have two applications A1 & A2 both are accesing the same databse table employee at the same time.
How can i manage this so that both application can get the correct no of emloyee while A1 is inserting a employee
at the same time while other applicatuion is getting the empployee list?
I can i maintain a session between these two applications.

Thanks
Chiranjeevi
 
Rob Spoor
Sheriff
Pie
Posts: 20531
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to our JDBC forum.
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is what transaction isolation levels are for. Any level other than READ_UNCOMMITTED should do it.

Is your code in a standalone Java app, or is it deployed to an app server? If the latter, are you using persistence? If so, all this is handled for you. If not, then you will have to commit the transactions yourself.

Are you using an ORM such as Hibernate? That could also change things a bit.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic