This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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 Android Security Essentials Live Lessons this week in the Android 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: 19654

Moving to our JDBC forum.

How To Ask Questions How To Answer Questions
Peter Johnson

Joined: May 14, 2008
Posts: 5812

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