aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes Transaction rollback on another AppServer 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 "Transaction rollback on another AppServer" Watch "Transaction rollback on another AppServer" New topic
Author

Transaction rollback on another AppServer

Prakash Dwivedi
Ranch Hand

Joined: Sep 28, 2002
Posts: 452
Hello Friends,
I have a sitiuation, where my SessionBean (say 'A') invokes SessionBean (say 'B') on another appserver. B makes some database updates and returns some values to 'A'. On the basis of the value retrieved from 'B', 'A' updates the database. Now my problem is if due some reason 'A' fails to update the database, than the changes made by 'B' should be rolled back.

I have set Transaction attributes for 'A' as requiresNew and for 'B' as required. But somehow it doesn't seems to work. I am using oracle 10gAS, and windows 2000.


regards


Prakash Dwivedi (SCJP2, SCWCD, SCBCD)
"Failure is not when you fall down, Its only when you don't get up again"
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

I dont think you can propagate transaction across different containers.


Groovy
Erwin Morales
Greenhorn

Joined: Feb 26, 2004
Posts: 8
i have doubts with this thing, i think you can't pass and control the transactions across application servers, create one transac for any bean, passing objects or anything.

au revoir


Erwin Morales<br />Ciudad de Mexico/Mexico City
Shrikrishna Patil
Greenhorn

Joined: Jun 08, 2004
Posts: 2
I think we can propagate transaction across different containers.
This is also known as "two phase commit".

I think the problem amy be with the prograaming code at EJB A or EJB B.

Generally the EJBException should be propagated up to the Container.
i.e we should not catch EJBException or RemoteException, if caught it should be rethrown again, so that the container will come to know that the exception has occured and then the container will rollback transaction.
I am assuming that the container is responsible for managing transactions.
Stas Sokolov
Ranch Hand

Joined: Apr 13, 2004
Posts: 117

2 Phase commit is some different issue :-)
http://www.cs.unc.edu/Courses/comp119/docs/lessons/java/java_ejb_transactions/

But my impression is that CORBA 2.0 was specialy built to support distributed transactions. Don't know if it works in practise.


Good luck for yourself.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Transaction rollback on another AppServer