• 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
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Transaction Attributes in ejb-jar.xml

 
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1) Suppose we set the <transaction-type> tag to Container in the ejb-jar.xml file and do not specify any <trans-attribute> tag what would be the default value of the transaction attribute that would be applied ?
2) When we use Bean Managed JTA, and get the UserTransaction from one component's session context, is this transaction context valid when we call a different (Bean Managed) component ? Since a JTA is managed by J2EE Server, would the called component use its own transaction context ?
 
PNS Subramanian
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Awaiting a reply
 
Ranch Hand
Posts: 333
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

1) Suppose we set the <transaction-type> tag to Container in the ejb-jar.xml file and do not specify any <trans-attribute> tag what would be the default value of the transaction attribute that would be applied ?


According to spec 17.5, The Deployer is responsible for ensuring that the methods of the deployed enterprise beans with container-managed transaction demarcation have been assigned a transaction attribute. If the transaction
attributes have not been assigned previously by the Assembler, they must be assigned by the Deployer.

So while deploying the beans, the deployer has to make sure that a valid tx attribute has been assigned to all methods defined in spec 17.4.1


2) When we use Bean Managed JTA, and get the UserTransaction from one component's session context, is this transaction context valid when we call a different (Bean Managed) component ? Since a JTA is managed by J2EE Server, would the called component use its own transaction context ?

This can depend on the type of transaction atrributes defined for the methods in the second component.
 
PNS Subramanian
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The question was not about who should specify the transaction attribute - the question is what would happen if we specify Container managed transaction without specifying the transaction attribute ? How would the application behave in this case ?

For the second questin, both the components have BeanManaged transaction as the transaction attribute. Would the second component's transaction override(/be independent of) the calling components transaction ?
 
It's just a flesh wound! Or a tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic