Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
  • Piet Souris
  • Himai Minh

Message Driven Beans and Transaction Attributes

Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
The EJB 2.0 spec says that Message Driven Beans (MDB) are only allowed a transactional attribute of either Required or NotSupported. The reasons it gives for this is as follows :
1) Since a MDB never gets called by a client so to speak, there is never a pre-existing transactional context, hence, RequiresNew and Supports, both which deal with client transactions, are meaningless to MDBs
2) Also, since Mandatory and Never throw exceptions to clients if the methods are executed in a transaction, and since there is never an MDB client, these 2 are also meaningless.
Now, I understand these 2 points totally. But in the same vein, why allow Required and NotSupported ??? Required also deals with client transactions (if one exists, Required means container will execute the transaction under the client transaction) and NotSupported suspends a client transaction (if one exists)...and since a MDB never has a client, these 2 also should be meaningless in the context of a MDB. So why allow these 2 but not the rest ??
I know that the container, according to the specs, creates a new transaction everytime for a MDB as it has no client, but I do not understand why it allows Requires and NotSupported, but not the others ???
Any ideas ??
mister krabs
Posts: 13974
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Suman, please not that we have a naming requirement at JavaRanch. Please re-register using your real first name-space-last name. Thanks.
Tom - Moderator of this board
I'm so happy! And I wish to make this tiny ad happy too:
Free, earth friendly heat - from the CodeRanch trailboss
    Bookmark Topic Watch Topic
  • New Topic