Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • 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 ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

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

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

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.

Thanks
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!