2

Having an MDB that receives a message in a transaction and then does several EJB calls if I call in one of those EJB's this.sessionContext.setRollbackOnly() will this trigger the JMS message's redelivery ?

All the EJB methods are marked with Requires_New transaction attribute.

MaDa
  • 10,511
  • 9
  • 46
  • 84
Sergiu
  • 2,502
  • 6
  • 35
  • 57

1 Answers1

1

No, because the MDB's transaction will be suspended while EJBs annotated with @REQUIRES_NEW are being processed — each within its own transaction. Additional assumption is that setRollbackOnly() is the only effect of rolling back an EJB's transaction, that is the EJB exited properly and did not throw any exception (after voting for rollback, further interaction with the resource may cause an exception from the javax.ejb.EJBException family to be thrown).

MaDa
  • 10,511
  • 9
  • 46
  • 84