Win a copy of Event Streams in Action this week in the Java in General 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
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

My exam cloud mock 3, about restrictions on bean managed transaction

 
Ranch Hand
Posts: 1742
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Which two are restrictions of beans with bean-managed transactions?
A. The NOT_SUPPORTED transaction attribute must be chosen.
B. Clients calling with a transactional context are prohibited and will result in an exception.
C. A stateful session bean must commit a started transaction before a business method returns.
D. A bean that starts a transaction must complete the transaction before it starts a new transaction.
E. A message-driven bean instance must commit a transaction before the onMessage method returns.
Given answer : D and E


But I think the answer should be B and E.
I think B is refering to nested transaction, which is not supported by EJB container.
For D, a bean can suspend a current transaction and start a new transaction. When that new transaction completes, the current
transaction resumes. There is an interface, TransactionManager, which defines suspend() and resume() methods.

 
Creator of Enthuware JWS+ V6
Posts: 3290
296
Android Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, D and E are correct.

I think B is refering to nested transaction, which is not supported by EJB container.  


D is referring to nested transactions: "A bean that starts a transaction must complete the transaction before it starts a new transaction." , you cannot do this in a Bean managed bean:

Option B is OK because it is allowed for a client to call a BMT bean with a transaction context, however the container will then suspend the active client transaction.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!