This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

TRANSACTION CONTEXT

 
Alibabra Sanjie
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In spec,
An enterprise bean instance can access resource managers in a transaction ONLY in the enterprise bean's methods in which there is a TRANSACTION CONTEXT available.

That means the transaction attribute of the method should be Required, RequiresNew, Mandatory in order to access resource managers? How about the supports?
 
Seema Manivannan
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For a CMT bean, if the transaction attribute is NotSupported or Never, the method executes with an unspecified transaction context. In the case of the Supports attribute, this happens only when the client calls without a transaction context.
To know more about enterprise bean methods in which a transaction context is not available, refer to section 17.6.5 of the EJB 2.0 Specs.
 
Alibabra Sanjie
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For a CMT bean, if the transaction attribute is NotSupported or Never, the method executes with an unspecified transaction context. In the case of the Supports attribute, this happens only when the client calls without a transaction context.

I believe that it's the opposit, in NotSupported or Never case, the method executes without a transaction context, and in the case of supports attribute, the method executes with unspecified transaction context. Correct me if I am wrong.
 
Seema Manivannan
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Unspecified transaction context´┐Ż refers to the cases where the EJB architecture does not fully define the transaction semantics of an enterprise bean method execution.
If the transaction attribute is "NotSupported" or "Never", even if the client method executes in a transaction context, it is not propogated to the bean. So the bean method always runs in an unspecified transaction context. If the attribute is "Supports", and the client method does not execute in a transaction context, then also this is the case.
Hope this helps.
Thanks
Seema
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic