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 isolation level Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "isolation level" Watch "isolation level" New topic

isolation level

binu sukumar

Joined: Aug 07, 2001
Posts: 7
In a java pgm using jdbc connection , I insert a record into DB , and then read the inserted data. AutoCommit is set to false for the connection. Isolation level is set to READ_COMMITTED using the method con.setIsolationLevel().
In this case, it should not be possible to read uncommited data.
But this is not working as intended.
Any idea, why ??
Thomas Kyte

Joined: Jul 15, 2001
Posts: 6
In the database, you can always see your changes. The isolation levels are there to isolate you from OTHER sessions, not yourself.
So, you can see your uncommitted changes regardless of the isolation level.
If you are using Oracle and need to see the values in the database without seeing your changes, you can use an autonomous transaction to open a ref cursor (result set from a stored procedure). These result set will be opened as if it were another session all together and will not see your changes.

Thomas Kyte ( <A HREF="" TARGET=_blank rel="nofollow"></A> <BR>Expert one on one Oracle, programming techniques and solutions for Oracle.<BR> <BR>Opinions are mine and do not necessarily reflect those of Oracle Corp
binu sukumar

Joined: Aug 07, 2001
Posts: 7
Thanks for the info !

I agree. Here's the link:
subject: isolation level
jQuery in Action, 3rd edition