Win a copy of OCP Oracle Certified Professional Java SE 11 Developer Practice Tests this week in the OCP forum!
  • 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:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Ron McLeod
  • Tim Cooke
Sheriffs:
  • Devaka Cooray
  • paul wheaton
  • Mark Herschberg
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
  • Jj Roberts
Bartenders:
  • Carey Brown
  • salvin francis
  • Piet Souris

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.
 
The City calls upon her steadfast protectors. Now for a tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic