Distributed Transactions Exception in J2EE
Posted on 2004-10-29
I'm facing a problem while developing some code in J2EE. I have a class which has two methods. One to insert a record in table ABC and another to update a record in table DEF. The transaction should be such that if there is an exception in either of the operations, the whole transaction should be rolled back. I'm calling the second method from the first one. While the first one is called from a session bean. When I use conn.commit() or conn.rollback(), it throws an exception saying commit or rollback cannot be called in distributed transactions.
also the whole transaction does not rollback. How can I properly handle such exceptions, and ensure that either both or none of the transactions occur?
Is it a problem of the driver used. I'm using Oracle as database, and Weblogic 8 as the app server.
can anybody help me out?
thanks in advance