1 of 1 people found this helpful
what kind of exception are we talking about? You need to distinguish between checked and unchecked exceptions. If it is a unchecked exception (e.g. RuntimeException) the container will do the rollback automatically. If it is a checked Exception (e.g. public void perform() throws IOException), then no rollback is performed.
This one might help you find further informations:
java - EJB3 transaction rollback - Stack Overflow
P.S. I saw you're talking about EJB2. I'm only familiar with EJB3 but i suppose the container might behave similarly.
Thanks for your reply. when we throw an unchecked exception (RuntimeException) such as EJBException the container is rolling back the transaction. where as if we throw a checked exception the container is not rolling back even though we have jta='true' in datasource.xml.
please let me know whether I am missing anything here.
Thanks in advance