- I've an EJB method methodA() which is annotated with TransactionAttribute.REQUIRES_NEW.
- methodA() calls two EJB methods (lets say methodB(), methodC())running on a remote server (IIOP communication)
- methodB() performs few database inserts.. methodB is also annotated with TransactionAttribute.REQUIRED
- methodC() which is is also annotated with TransactionAttribute.REQUIRED and I'm making it throw some runtime exception to test transaction management.
- When I test my methodA for transaction management, I noticed the following ..
In OpenEJB log,
TX Requires_New: No transaction to suspend.
TX Requires_New : Started Transactions ... gerenimo TransactionImpl....
logs from methodB execution... completes.
methodC throws some RuntimeException
TX Requires_New : Rolling Back transaction...
============
Even though it says Transaction is being rolled back.. the database records saved through methodA() still appears in the database. I want the database inserts should be rolled back as well.
Can you please help me understand what might be going wrong?