* result = rollback
*/
@Test
public void testMultipleSourceMultipleCommandsReferentialIntegrityRollback() throws Exception {
AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testMultipleSourceMultipleCommandsReferentialIntegrityRollback") {
public void testCase() throws Exception {
for (int i = 700; i < 710; i++) {
Integer val = new Integer(i);
execute("insert into pm1.g1 (e1, e2) values(?,?)", new Object[] {val, val.toString()});
execute("insert into pm1.g2 (e1, e2) values(?,?)", new Object[] {val, val.toString()});
execute("insert into pm2.g1 (e1, e2) values(?,?)", new Object[] {val, val.toString()});
execute("insert into pm2.g2 (e1, e2) values(?,?)", new Object[] {val, val.toString()});
}
// 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 >= 700 and e1 < 710");
test.assertRowCount(10);
test = new QueryExecution(userTxn.getSource("pm2"));
test.execute("select * from g1 where e1 >= 700 and e1 < 710");
test.assertRowCount(10);
}