aspose file tools*
The moose likes JDBC and the fly likes isolation level Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "isolation level" Watch "isolation level" New topic
Author

isolation level

binu sukumar
Greenhorn

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
Greenhorn

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 (tkyte@us.oracle.com) <A HREF="http://asktom.oracle.com/" TARGET=_blank rel="nofollow">http://asktom.oracle.com/</A> <BR>Expert one on one Oracle, programming techniques and solutions for Oracle.<BR>http://www.amazon.com/exec/obidos/ASIN/1861004826/ <BR>Opinions are mine and do not necessarily reflect those of Oracle Corp
binu sukumar
Greenhorn

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

 
wood burning stoves
 
subject: isolation level