This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
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 ??
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 (email@example.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