Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Tx attribute question

 
faiza athar
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
  • 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 ?
 
Chris Mathews
Ranch Hand
Posts: 2712
  • Mark post as helpful
  • send pies
  • 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.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!