What is the correct way of rolling back the transaction of a container managed JTA transaction?
I understand this: EJBException when calling entityManager.getTransaction() that I can't get the transaction instance. I read a solution here but I'm not sure whether this is correct.
I'm also aware that, if I throw an exception, the transaction will be rolled back.
But my question is: if I want to (must) use a container managed EntityManager
, what's the correct way of rolling back a transaction inside it?