This week's book giveaway is in the JavaScript forum.
We're giving away four copies of JavaScript Promises Essentials and have Rami Sarieddine on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes Calling three EJB methods in a single transaction Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Calling three EJB methods in a single transaction" Watch "Calling three EJB methods in a single transaction" New topic
Author

Calling three EJB methods in a single transaction

v sat
Greenhorn

Joined: Sep 13, 2007
Posts: 7
Hi,
I have an action class that calls three EJB methods. I want to run all these three method in a single transaction. How do I do it?
Thanks,
Venkat
Jimmy Clark
Ranch Hand

Joined: Apr 16, 2008
Posts: 2187
Well, there should be a Business Delegate in the middle of your call to the business methods. Actions objects should never call directly on EJB methods...
v sat
Greenhorn

Joined: Sep 13, 2007
Posts: 7
Thanks for the reply. I still have a doubt on how to implement this transction in the business facade layer?
Ranganathan Kaliyur Mannar
Bartender

Joined: Oct 16, 2003
Posts: 1088
    
  10

If you have a session facade and a method which invokes these 3 methods, then you can annotate that method with @TransactionAttribute(REQUIRED). This is for CMT.

Otherwise, you should lookup the UserTransaction and handle it manually.


Ranga.
SCJP 1.4, OCMJEA/SCEA 5.0.
 
jQuery in Action, 2nd edition
 
subject: Calling three EJB methods in a single transaction