code: private ResourceException closeHandles() {
          ResourceException firstX = null;
          Object conn = null;
  
          // Indicate that we are cleaning up handles, so we know not to send events for
          // operations done in the cleanup. 
          cleaningUpHandles = true;
  
          for (int i = numHandlesInUse; i > 0;) 
          {
              conn = handlesInUse[--i]; 
              handlesInUse[i] = null; 
  
              try {
                  ((WSJdbcConnection) conn).close();
              } catch (SQLException closeX) {
                  FFDCFilter.processException(closeX,
                                              getClass().getName() + ".closeHandles", "1414", this);
  
                  if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
                      Tr.event(this, tc, 
                               "Error closing handle. Continuing...", conn);
  
                  ResourceException resX = new DataStoreAdapterException(
                                  "DSA_ERROR", closeX, getClass());
  
                  if (firstX == null)
                      firstX = resX;
              }
          }
  
          numHandlesInUse = 0; 
          cleaningUpHandles = false;
  
          return firstX;
      }
docs: Closes all handles associated with this ManagedConnection. Processing continues even
  if close fails on a handle. All errors are logged, and the first error is saved to be
  returned when processing completes.
  
  @return the first error to occur closing a handle, or null if none.