• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

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.

Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!