TransactionAccountFrom accFromAfter = pm.getByKey(TransactionAccountFrom.class, accFrom.id);
assertTrue(900L == accFromAfter.amount);
}
public void testTransactionSaveBatchFailure() {
TransactionAccountFrom accFrom = new TransactionAccountFrom(1000L);
pm.insert(accFrom);
try {
pm.beginTransaction(Connection.TRANSACTION_READ_COMMITTED);
accFrom.amount-=100L;
pm.save(accFrom);
throw new SienaException("test");
}catch(SienaException e){
pm.rollbackTransaction();
}finally{
pm.closeConnection();
}
TransactionAccountFrom accFromAfter = pm.getByKey(TransactionAccountFrom.class, accFrom.id);
assertTrue(1000L == accFromAfter.amount);
}