Do you know how I can get XAResource that is automaticaly enlist to my transaction when I use my entity manager ?
I use Bitronix, JPA, hibernate, my code works fine, but I don't want to rollback all my XAResources if one specific failed. I just want to delist it from the current transaction and others will be commited.
But for delist it of the current transaction, I need the object XaResource and I don't know how i get it with JPA/Bitronix. example of code :
transactionManager.begin();
try {
(...)
EntityManager em = emf.createEntityManager();
(...)
em.close();
} catch (Exception e) {
// old version - rollback every XaResource in the current transaction
//transactionManager.rollback();
//new version wanted - rollbackonly this XaResource
transactionManager.getTransaction().delistResource(XaResource ...);
throw e;
}
transactionManager.commit();
Thanks for your help.