How to programmatically find if EJB is operating in transaction mode
posted 9 years ago
I've an MDB which can be configured to run in either transactional or not-transactional mode at the container level. This is defined in the deployment descriptor with the trans attribute or "Required" or "NotSupported" The relevant snippet from the deployment xml is as follows
Within the onMessage method I want to check if the MDB is running in transaction mode & if so call the setRollbackOnly() method if an exception occurs.
Is there some way I can inspect the EJB Context to determine if the MDB is configured as transactional or non-transactional? I want to prevent calling the setRollbackOnly on non-transactional MDBs.