Transaction is not rolling back
843829Nov 15 2003 — edited Nov 24 2003I have statefull session CMT bean and I have a method
public void meth1() {
try {
dao1.method1(connection);
dao2.method2(connection);
} catch (SQLException ex) {
sessioncontext.setRollbackOnly();
throw (application exception);
}
}
If dao2.method2 raises sqlexception then whatever happend in dao1.method1 is committed. I have "Required" as transaction attribute for this session method.
Also I cannot raise system exception as this removes the session bean instance. We are using j2ee 1.2.
How to rollback for application errors.
Thanks in advance