• 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 attributes

 
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I came across this question in a mock exam.
Which of the following EJB Transaction Attributes ensures that the method call always takes place in a transaction, either client started, or container started? Select 2 correct Choices.
1.TX_MANDATORY

2.TX_REQUIRED
3.TX_REQUIRES_NEW
Answer given: 2,3.
Why is not 1 a valid option.
 
Ranch Hand
Posts: 390
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
TX_REQUIRED and TX_REQUIRES_NEW will always run in a transaction. TX_REQUIRED will start a new transaction where non exists and TX_REQUIRES_NEW will always run in a new transaction irrespective of whether one exists or not but TX_MANDATORY will throw an exception if called without an existing transaction.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic