Uploaded image for project: 'Aries'
  1. Aries
  2. ARIES-1885

JpaInterceptor does not properly end coordination in case of Exception

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • jpa-2.7.1
    • jpa-2.7.2
    • JPA
    • None

    Description

      In class JpaInterceptor the method postCallWithException calls Coordination.fail() but not Coordination.end():

      @Override
      public void postCallWithException(ComponentMetadata cm, Method m, Throwable ex, Object preCallToken) {
          LOG.debug("PostCallWithException for bean {}, method {}", cm.getId(), m.getName(), ex);
          if (preCallToken != null) {
              ((Coordination)preCallToken).fail(ex);
          }
      }
      
      

       

      However, the javadoc of Coordination.fail() states:

      If this Coordination has been {@link #push() pushed} onto a thread local Coordination stack, this Coordination is not removed from the stack. The creator of this Coordination must still call {@link #end()} on this Coordination to cause it to be removed from the thread local Coordination stack.
      

      This is causing issues for subsequent calls to jpa service because the coordination is not removed from the stack.

      The method postCallWithException should be implemented like this:

      @Override
      public void postCallWithException(ComponentMetadata cm, Method m, Throwable ex, Object preCallToken) {
          LOG.debug("PostCallWithException for bean {}, method {}", cm.getId(), m.getName(), ex);
          if (preCallToken != null) {
              Coordination coordination = (Coordination)preCallToken;
              coordination.fail(ex);
              coordination.end();
          }
      }
      

       

      Attachments

        Issue Links

          Activity

            People

              cschneider Christian Schneider
              nicolas.dutertry Nicolas Dutertry
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m