I'm attempting to demonstrate a phantom read in MySQL through the use of JDBC. I understand that under the REPEATABLE-READ isolation level, phantoms should be possible. But I can't get one to happen. My transactions are set up as follows:
Transaction 1:
querySetOne[0] = "use adventureworks";
querySetOne[1] = "select * from vendorcontact where ContactTypeID between 10 and 30";
querySetOne[2] = "select sleep(20)";
querySetOne[3] = "select * from vendorcontact where ContactTypeID between 10 and 30";
querySetOne[4] = "COMMIT";
Transaction 2:
querySetTwo[0] = "use adventureworks";
querySetTwo[1] = "select sleep(2)";
querySetTwo[2] = "insert into vendorcontact values (105, 700, 20, NULL)";
querySetTwo[3] = "COMMIT";
I have them in arrays b/c I'm using the Statement.execute() method to execute each line and I have autocommit set to false.
Why does the query from querySetOne[1] and querySetOne[3] return the same results under the repeatable read isolation level??