This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
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


Win a copy of Head First Android this week in the Android forum!
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: 352

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: 8927

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


Groovy
Abhinav Srivastava
Ranch Hand

Joined: Nov 19, 2002
Posts: 352

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

Joined: Feb 27, 2002
Posts: 8927

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: 352

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: 8927

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

No difference, the same rule holds good.
 
jQuery in Action, 3rd edition
 
subject: EJB Transaction
 
It's not a secret anymore!