| Hi,
 I'm having problems rolling back my entire transaction.  One of the update statements generates an SQLException which I trap and then rollback.
 
 Rolling back doesn't roll back the entire transaction, however.  Only the failed update.
 
 Can someone help?
 
 Here's what my code looks like:
 
 Transaction t = null;
 Session s = null;
 
 try {
 s = openSession(); // thread local session pattern
 t = s.beginTransaction();
 
 do updates... 1 ... N // update n fails
 
 if (t != null) t.commit();
 } catch (HibernateException) {
 if (t != null) try { t.rollback } catch (...) {...}
 throw new MyException(...);
 }
 
 All the successful updates 1...n-1 are still committed to the database.
 
 Here's the stack trace:
 
 Hope this comes out in a readable fashion and thanks for any help.
 
 2004-04-30 10:25:05,843 ERROR [net.sf.hibernate.util.JDBCExceptionReporter] ORA-20001: Status 5 Loans Must Be Rate Locked!
 ORA-06512: at "PUB.PTP_LOANS_CLIENT_STATUS", line 28
 ORA-04088: error during execution of trigger 'PUB.PTP_LOANS_CLIENT_STATUS'
 
 2004-04-30 10:25:05,843 ERROR [net.sf.hibernate.util.JDBCExceptionReporter] ORA-20001: Status 5 Loans Must Be Rate Locked!
 ORA-06512: at "PUB.PTP_LOANS_CLIENT_STATUS", line 28
 ORA-04088: error during execution of trigger 'PUB.PTP_LOANS_CLIENT_STATUS'
 
 2004-04-30 10:25:05,859 ERROR [net.sf.hibernate.util.JDBCExceptionReporter] Could not synchronize database state with session
 java.sql.BatchUpdateException: ORA-20001: Status 5 Loans Must Be Rate Locked!
 ORA-06512: at "PUB.PTP_LOANS_CLIENT_STATUS", line 28
 ORA-04088: error during execution of trigger 'PUB.PTP_LOANS_CLIENT_STATUS'
 
 at oracle.jdbc.dbaccess.DBError.throwBatchUpdateException(DBError.java:459)
 at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:3907)
 at weblogic.jdbc.pool.Statement.executeBatch(Statement.java:957)
 at net.sf.hibernate.impl.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:50)
 at net.sf.hibernate.impl.BatcherImpl.executeBatch(BatcherImpl.java:105)
 at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2103)
 at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2062)
 at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2005)
 at net.sf.hibernate.transaction.JTATransaction.commit(JTATransaction.java:52)
 at com.ditech.loanexceptions.ejb.LoanExceptionsBean.approve(LoanExceptionsBean.java:183)
 at com.ditech.loanexceptions.ejb.LoanExceptionsBean_79ohop_EOImpl.approve(LoanExceptionsBean_79ohop_EOImpl.java:475)
 at com.ditech.loanexceptions.actions.ApproveLoanExceptionAction.doAction(ApproveLoanExceptionAction.java:78)
 at com.ditech.loanexceptions.actions.AppBaseAction.execute(AppBaseAction.java:81)
 at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
 at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
 at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
 at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:262)
 at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:198)
 at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2678)
 at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2412)
 at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:140)
 at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:121)
 2004-04-30 10:25:05,859 ERROR [com.ditech.loanexceptions.ejb.LoanExceptionsBean] approve: HibernateException - ROLLING BACK
 2004-04-30 10:25:05,890 ERROR [com.ditech.loanexceptions.ejb.LoanExceptionsBean] approve: HibernateException occured
 
 
 |