• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to programmatically find if EJB is operating in transaction mode  RSS feed

Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.

Any help greatly appreciated.

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!