• 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 ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Transaction from HF Page 497

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
From Page 497 EJB Transaction
2.Which transaction attribute (or attribute) must NOT be used by a message - driven bean?
ANSWER : Mandatory,RequireNew,Support,Never
I suspect how to get those answers. Would you please expain me on detail these answers.

4.Of the six transaction attribute,three of them can be dangerous,with one in particular being EXTREMELY risky. Keeping in mind that the Bean Provider is NOT the one who specifiers the attributes of the bean's methods,which of the six is potentially the most dangerous?
ANSWER:Mandatory & NotSupport are dangerous,Because they throw exceptions,But Support is the riskiest,....because it means at runtime you don't know whether it will run in a transaction or Not
I suspect why this answer is Mandatory & Never.Would you please expain me on detail about Support is riskeist,Why isn't NotSupport Or Never?

Thank a lot for kindly your advice!!!
 
Ranch Hand
Posts: 884
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


2.Which transaction attribute (or attribute) must NOT be used by a message - driven bean?
ANSWER : Mandatory,RequireNew,Support,Never



The reason is stated in the EJB 2.0 specifications page 362, section 17.6.3. These 4 transaction attributes are not meaningful in the case of MDB. Mandatory & Never throws exceptions but we've no clients to handle them. There can never be pre-existing transaction context, hence RequiresNew & Supports are also meaningless.

Of course you could argue that RequiresNew can serve the same purpose as Required but too bad the designer of the specifications chose Required over RequiresNew.


4. Of the six transaction attribute,three of them can be dangerous,with one in particular being EXTREMELY risky. Keeping in mind that the Bean Provider is NOT the one who specifiers the attributes of the bean's methods,which of the six is potentially the most dangerous?
ANSWER:Mandatory & NotSupport are dangerous,Because they throw exceptions,But Support is the riskiest,....because it means at runtime you don't know whether it will run in a transaction or Not
I suspect why this answer is Mandatory & Never.Would you please expain me on detail about Support is riskeist,Why isn't NotSupport Or Never?



For Supports attribute, could you possibly safely still make use of getRollbackOnly & setRollbackOnly methods in your codes? You can't be certain that there'll be a pre-existing context. There can be 1 or there can be none. Supports attribute doesn't care.

Hope these helps.
 
reply
    Bookmark Topic Watch Topic
  • New Topic