It seems to me that if a trnasaction has not been commited; I should not be in the database and therefore; I should not be able to see in the result set before printing and I should not be able to see in the print out statement. In this program I commit the first insert query only; but not the second. Then I read from the database and print. It seems that as long as the select query is issued; even if the insert has has not been committed yet; the value has been inserted in the database and it can be printed. Also, the second connection; can read the data and print it becuase it is in the database. I do not udnerstand. Could any body read my code?
I have tried uncommenting conn1 isolation level only, conn2 isolation level only and both and I keep getting the same result. I wonder if the setTransationIsolation is working. May be I need some permissions to get it working?
Joined: Jul 15, 2011
This is anew version of the same problem. I have looked in many places to see how this is done and it seems that I am writing this code correctly. Still get a dirty read though. Any ideas of wht might be going wrong? The output is:
transation isolation level = 4
Transaction isolation level c1 set to 8
Transaction isolation level c2 set to 8