• 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

HFEJB-497 Page- 4th qs

 
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Of the six transaction attibutes, three of them can be dangerous, with one on particular being EXTREMELY risky.Keeping in mind that Bean provider is not the one who specifies the attributs for the bean's methods, which of the six is potentially the most dangerous?

As per online ans:- Mandatory and NotSupported are dangerous, because they throw Exception.

Is NotSupported throw exception? Is this Ans is correct?
 
Author & Gold Digger
Posts: 7617
6
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The transaction attributes do not throw exception by themselves. However, the container will throw an exception if it detects some unconsistent behavior. For instance, the container will throw the java.lang.IllegalStateException if either getRollbackOnly() or setRollbackOnly() are invoked from a business method executing with the Supports, NotSupported or Never transaction attributes (17.6.2.8 + 17.6.2.9). Thus, it is possible that an exception be thrown when the NotSupported attribute is specified.
 
vijay Mamilla
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Valentin
 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Valentin Crettaz:
For instance, the container will throw the java.lang.IllegalStateException if either getRollbackOnly() or setRollbackOnly() are invoked from a business method executing with the Supports, NotSupported or Never transaction attributes (17.6.2.8 + 17.6.2.9). Thus, it is possible that an exception be thrown when the NotSupported attribute is specified.



I understand that a transaction with "NotSupported" attribute can throw exception and hence can be dangerous. But I don't understand how "NotSupported" is more dangerous than "Never". In "Never" too there is possibility of having methods calls to get/setRollbackOnly() that cause an exception. Also in "Never" an Exception can be thrown if called from a transaction which is not the case in "NotSupported" as it just suspends the transaction. :roll:
[ May 17, 2005: Message edited by: ana ]
 
vijay Mamilla
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I agree with you.
 
reply
    Bookmark Topic Watch Topic
  • New Topic