Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Transaction rollback on another AppServer

 
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
 
Ranch Hand
Posts: 8943
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I dont think you can propagate transaction across different containers.
 
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
 
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.
 
Ranch Hand
Posts: 120
IntelliJ IDE Hibernate 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic