I have a dude with the CacheTransactionManager
I have this code:
CacheTransactionManager txMgr = CacheFactory.getAnyInstance().getCacheTransactionManager();
try
{
txMgr.begin();
region.put("1","1);
region2.put("2","1);
txMgr.commit();
}
catch(Exception e)
{
txMgr.rollback();
}
Those regions are empty and have a Listener, that in the afterCreate put the events of the empty region in a persited region.
The question is that in the case when the Listener fail, the transaction was commited and I haven't a control of that.
I need that the action in the listener is transactional and if the listener fail do a rollback.
I can do this?