Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS 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
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

doubt is mock exam question

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The statement is true or false: While an enterprise bean instance is associated with a transaction it must not access resource manager specific transaction demarcation API

The answer is true.Can any one explain me?
 
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mohammed,

While an enterprise bean instance is associated with a transaction it must not access resource manager specific transaction demarcation API.



The EJB architecture don't support nested (child) transactions. If the bean is in a transaction then it can't demarcate another transaction boundaries.
I supose that *transaction demarcation API* is javax.transaction.UserTransaction's methods.

Vagner
 
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That statement is correct. you can not mix CMT with BMT.
 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

I supose that *transaction demarcation API* is javax.transaction.UserTransaction's methods.



I don't suppose so...
See [27] p.334 of the spec:

The terms resource-manager udsed in this chapter refer to the ressources declared in the deployment descriptor using the resource-ref element. This includes not only databases resources, but also JMS connections...these resources are considered to be all managed by the container



and p.340:

While an instance is in a transaction, the instance must not attempt to use the resource-manager specific transaction demarcation API i.e must not commit or rollback method on the java.sql.Connection interface or on the javax.jms.Session interface



in case of BMT cf spec p.340 �17.3.3, it's probably because nested transactions are not allowed.
in case of CMT, cf spec p.348 �17.3.4, its's because

you shouldn't interfere with the Container's demarcation of transaction boundaries



Sometimes, it's worth reading the spec;-)

Regards,
Cyril.
[ November 18, 2004: Message edited by: cyril vidal ]
 
My first bit of advice is that if you are going to be a mime, you shouldn't talk. Even the tiny ad is nodding:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic