wood burning stoves 2.0*
The moose likes EJB and other Java EE Technologies and the fly likes EJB and Transactions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "EJB and Transactions" Watch "EJB and Transactions" New topic
Author

EJB and Transactions

Pappu Kumar
Ranch Hand

Joined: Oct 01, 2002
Posts: 69
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 ?
Razi Abbas
Greenhorn

Joined: Apr 30, 2002
Posts: 9
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: EJB and Transactions
 
Similar Threads
[JTA] Distributed transactions questions
Transaction Attributes in EJB
Transaction Attribute setting in CMP
Transaction context
operations allowed in the methods of Stateful session bean