Tuscany
  1. Tuscany
  2. TUSCANY-3970

Improve error handling in TransportServiceInterceptor.invoke()

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: Java-SCA-2.x
    • Fix Version/s: Java-SCA-2.x
    • Component/s: SCA Java Runtime
    • Labels:
      None

      Description

      In the TransportServiceInterceptor,invoke method, in the first catch block (corresponding to calling invokeResponse), if there is an error or runtime exception, this should be re-thrown. This allows transacted messages to be rolled back.

      Also, in the finally block, a new try/catch block should be added around "((JMSBindingContext)msg.getBindingContext()).closeJmsResponseSession();", so if an error is thrown the resource factory can be used to close the connection:

      try

      { ((JMSBindingContext)msg.getBindingContext()).closeJmsResponseSession(); }

      catch (Throwable t) {
      }
      // Use the resource factory in the binding context to close the response connection,
      // to ensure we use same resource factory used to close response session.
      JMSResourceFactory rf = ((JMSBindingContext)msg.getBindingContext()).getJmsResourceFactory();
      if (rf.isConnectionClosedAfterUse())
      rf.closeResponseConnection();

        Activity

        Hide
        ant elder added a comment -

        Done as suggested

        Show
        ant elder added a comment - Done as suggested

          People

          • Assignee:
            Unassigned
            Reporter:
            Jennifer A Thompson
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development