Win a copy of JDBC Workbook this week in the JDBC and Relational Databases forum
or A Day in Code in the A Day in Code 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
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

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

 
Ranch Foreman
Posts: 1897
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: 3341
303
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.
 
I AM MIGHTY! Especially when I hold this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic