• 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

Tx attribute question

 
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1)Which of the following EJB Transaction Attributes ensures that all transactions are always demarcated by the container (automatic demarcation)?
TX_SUPPORTS
TX_MANDATORY
TX_REQUIRED
TX_REQUIRES_NEW
my ans: TX_REQUIRED
???
2)Which of the following EJB Transaction Attributes ensures that the method call always takes place in a transaction, either client started, or container started?
TX_SUPPORTS
TX_MANDATORY
TX_REQUIRED
TX_REQUIRES_NEW
my ans: TX_REQUIRED
can anyone confirm ?
 
Ranch Hand
Posts: 2713
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The answer to the first question is TX_REQUIRES_NEW.
TX_REQUIRED just marks the ejb or method as being required to run in the context of a transaction. The transaction that it runs within may or may not have been created by the container.
TX_REQUIRES_NEW says that the ejb or method must run in a new transaction that is demarcated by the container.
Your answer for number two is correct.
 
Destroy anything that stands in your way. Except this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic