Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

Transaction context propogation

 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have an Entity Bean with two methods A() & B() with the following transaction attributes

A() - Required
B() - Required

Processing is as follows:

Client -> some logic -> A() -> B()

client is not associated with any transaction context & method A() internally calls method B().

What would happen to the transaction context of B()? Would it get the same transaction context that was started in A(), or would it create a new one.

The specs say that the container interposes every method invocation on the home or component interface and applies the transaction parameters accordingly. In the above case the call from A() to B() is not a remote one, but a local one.
 
Ranch Hand
Posts: 250
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Since the transaction attribute is set to 'Required' for method B() and A() is internally calling B() then method B() will run in the transaction context of method A().


cheers.
[ May 12, 2005: Message edited by: sawan parihar ]
 
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
B will run in A's transaction context. I don't think it makes any difference whether the call is local or remote.
 
My name is Inigo Montoya, you killed my father, prepare to read a tiny ad:
The trailboss has a kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic