}
public void testTransactionUpdateBatchFailure() {
if(supportsTransaction()){
TransactionAccountFrom accFrom = new TransactionAccountFrom(1000L);
TransactionAccountTo accTo = new TransactionAccountTo(1000L);
pm.insert(accFrom, accTo);
try {
pm.beginTransaction(Connection.TRANSACTION_READ_COMMITTED);
accFrom.amount-=100L;
accTo.amount+=100L;
pm.update(accFrom, accTo);
throw new SienaException("test");
}catch(SienaException e){
pm.rollbackTransaction();
}finally{
pm.closeConnection();
}
TransactionAccountFrom accFromAfter = pm.getByKey(TransactionAccountFrom.class, accFrom.id);
assertTrue(1000L == accFromAfter.amount);
TransactionAccountTo accToAfter = pm.getByKey(TransactionAccountTo.class, accTo.id);
assertTrue(1000L == accToAfter.amount);
}
}