• 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

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

 
Bartender
Posts: 2119
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 3395
312
Android Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 have a knack for fixing things like this ... um ... sorry ... here is a consilitory tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic