File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC 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 EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
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: 19543

Moving to our JDBC forum.

How To Ask Questions How To Answer Questions
Peter Johnson

Joined: May 14, 2008
Posts: 5772

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
Similar Threads
Object HashCode in HashMap
Custom keys in tree map
Read file from directory, update contents of the each file
Hibernate: table per class inheritance
Tunneling Concept Query