Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Transaction is not rolling back

843829Nov 15 2003 — edited Nov 24 2003
I 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


Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 22 2003
Added on Nov 15 2003
6 comments
154 views