Uploaded image for project: 'OpenEJB'
  1. OpenEJB
  2. OPENEJB-1342

Exception thrown from tx cleanup in finally block supresses cause

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 4.0
    • None
    • container system
    • None

    Description

      If you have code like this in a bean-managed tx ejb:

      ut.begin();
      throw new RuntimeException("unexpected error");
      ut.commit();

      then code like this, present in all the containers, will suppress the runtime exception in favor of an uninformative message that you failed to end the transaction:

      (from SingletonInstanceManager)

                  try{
                      //Call the chain
                      interceptorStack.invoke();                
                  } catch(Throwable e) {
                      //RollBack Transaction
                      EjbTransactionUtil.handleSystemException(transactionPolicy, e, callContext);
                  }
                  finally{
                      EjbTransactionUtil.afterInvoke(transactionPolicy, callContext); // this throws the uninformative exception
                  }
      

      Just about every use of EjbTransactionUtil.afterInvoke suffers from this problem.

      Attachments

        Activity

          People

            Unassigned Unassigned
            djencks David Jencks
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: