* Batching = Full Processing, Single Connector Batch
* result = commit
*/
@Test
public void testMultipleSourceMultipleVirtualCommandsRollback() throws Exception {
AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testMultipleSourceMultipleVirtualCommandsRollback") {
public void testCase() throws Exception {
for (int i = 600; i < 615; i++) {
Integer val = new Integer(i);
execute("insert into vm.g1 (pm1e1, pm1e2, pm2e1, pm2e2) values(?,?,?,?)", new Object[] {val, val.toString(), val, val.toString()});
execute("insert into vm.g2 (pm1e1, pm1e2, pm2e1, pm2e2) values(?,?,?,?)", new Object[] {val, val.toString(), val, val.toString()});
}
execute("update vm.g1 set pm1e2='blah' where pm1e1 >= 605");
execute("delete from vm.g2 where vm.g2.pm1e1 >= 610");
execute("delete from vm.g1 where vm.g1.pm1e1 >= 610");
execute("select * from vm.g1 where pm1e1 >= 600 and pm1e1 < 615");
assertRowCount(10);
// force the rollback by trying to insert an invalid row.
execute("insert into pm1.g2 (e1, e2) values(?,?)", new Object[] {new Integer(9999), "9999"});
}
public boolean exceptionExpected() {
return true;
}
};
// run test
getTransactionContainter().runTransaction(userTxn);
// now verify the results
AbstractQueryTest test = new QueryExecution(userTxn.getSource("pm1"));
test.execute("select * from g1 where e1 >= 600 and e1 < 615");
test.assertRowCount(0);
test.execute("select * from g2 where e1 >= 600 and e1 < 615");
test.assertRowCount(0);
test.execute("select distinct e2 from g1 where e1 >= 600 and e1 < 615");