• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Transaction rollback on another AppServer

 
Prakash Dwivedi
Ranch Hand
Posts: 452
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Pradeep bhatt
Ranch Hand
Posts: 8927
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I dont think you can propagate transaction across different containers.
 
Erwin Morales
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Shrikrishna Patil
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Stan Sokolov
Ranch Hand
Posts: 120
Hibernate IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic