final Object myUserObject = new Object();
Transaction tx = Ebean.beginTransaction();
tx.putUserObject("myUserObject", myUserObject);
TWithPreInsert e = new TWithPreInsert();
e.setTitle("Mister Transaction1");
Ebean.save(e);
tx.commit();
assertNotNull(MyTestTransactionEventListener.getLastCommitted());
assertSame(MyTestTransactionEventListener.getLastCommitted(), tx);
assertNotNull(MyTestTransactionEventListener.getLastCommitted().getUserObject("myUserObject"));
assertSame(MyTestTransactionEventListener.getLastCommitted().getUserObject("myUserObject"), myUserObject);
assertNull(MyTestTransactionEventListener.getLastRollbacked());
Transaction tx2 = Ebean.beginTransaction();
tx2.putUserObject("myUserObject2", myUserObject);
TWithPreInsert e2 = new TWithPreInsert();
e2.setTitle("Mister Transaction2");
Ebean.save(e2);
tx2.rollback();
assertNotNull(MyTestTransactionEventListener.getLastCommitted());