Win a copy of Rust Web Development this week in the Other Languages 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

EJB and Transactions

 
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Consider the following scenario :
A client (within a Transaction scope) calls an EJB(say "x-ejb") which has Transaction Attribute = Required . Now this x-ejb calls another EJB(say "y-ejb"). y-ejb has Transaction Attribute = NotSupported....would the y-ejb be part of the transaction scope ?
what would happen if y-ejb has Transaction Attribute = Never ?
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
a) When the client which is already part of a transaction context calls a method of EJB-X with "REQUIRED" attribute, then the container will include the method execution as part of the same transaction context. When the method of EJB-X further calls a method of EJB-Y with the attribute "NOT_SUPPORTED" then the current transaction context will be suspended. The transaction will resme once the control is passed back to the calling method of EJB-X.
b) The "NEVER" attribute definition states that the method with this transaction boundary should never be called by a client which is running in a transaction context. So in the above scenario the calling method of EJB-X will receive a RemoteException since it is associated with a transaction context.
 
You showed up just in time for the waffles! And this tiny ad:
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