Meaningless Drivel is fun!*
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
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Data Access problem" Watch "Data Access problem" New topic
Author

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.

Thanks
Chiranjeevi
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19761
    
  20

Moving to our JDBC forum.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5843
    
    7

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: http://aspose.com/file-tools
 
subject: Data Access problem