Win a copy of Spark in Action this week in the Open Source Projects 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

TRANSACTION CONTEXT

 
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?
 
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
 
    Bookmark Topic Watch Topic
  • New Topic