File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes EJB Transaction Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "EJB Transaction" Watch "EJB Transaction" New topic
Author

EJB Transaction

Abhinav Srivastava
Ranch Hand

Joined: Nov 19, 2002
Posts: 349

There is an EJB having two methods with different transaction attributes. From Client, I invoke one method and this one internally calls the other method. Which transaction attribute will prevail?
Suppose the second method is in another ejb which is invoked from the first method of the first ejb. What will happen in this case?
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8904

It is difficlut to comment unless you share woth us the transaction attributes.


Groovy
Abhinav Srivastava
Ranch Hand

Joined: Nov 19, 2002
Posts: 349

I am asking if it is driven by a rule/logic.
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8904

The rule.
For e.g. method1 with tx attribute requiresnew calls method2 with attribue required the same thransaction context will be used in method 2 as well.
Abhinav Srivastava
Ranch Hand

Joined: Nov 19, 2002
Posts: 349

If the second method is locally called, then the tx attribute of the first method prevails. What about the case when one ejb method invokes a method on a different ejb.
[ September 12, 2003: Message edited by: abhinav srivastava ]
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8904

What about the case when one ejb method invokes a method on a different ejb.

No difference, the same rule holds good.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: EJB Transaction
 
Similar Threads
Problem In EJB Transaction Management
how to start a transaction from client side in CMT
Transaction Question from spec
Is this a nested transaction?
Distributed transactions