File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes Data Access problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Barcodes with iOS this week in the iOS forum
or Core Java for the Impatient in the Java 8 forum!

JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Data Access problem" Watch "Data Access problem" New topic

Data Access problem

chiranjeevi gunturu
Ranch Hand

Joined: Mar 02, 2007
Posts: 59
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.

Rob Spoor

Joined: Oct 27, 2005
Posts: 19896

Moving to our JDBC forum.

How To Ask Questions How To Answer Questions
Peter Johnson

Joined: May 14, 2008
Posts: 5846

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.

JBoss In Action
I agree. Here's the link:
subject: Data Access problem