docs: @Override
      public void afterCompletion(int status) {
  
          if (tc.isEntryEnabled()) {
              Tr.entry(this, tc, "afterCompletion");
          }
  
          if (tc.isDebugEnabled()) {
              Tr.debug(
                       tc,
                       "Using transaction wrapper@" + Integer.toHexString(this.hashCode()));
          }
  
          if (mcWrapper.isMCAborted()) {
              Tr.exit(tc, "Connection was aborted. Exiting afterCompletion.");
              return;
          }
  
          // When afterCompletionCode is called we need to reset the registeredForSync flag.
          registeredForSync = false;
          this.hasRollbackOccured = false;
          /*
           * Mark the transaction complete in the wrapper
           */
          // Do NOT catch runtime exections here.  Let them flow out of the component.
          mcWrapper.transactionComplete();
  
          if (tc.isDebugEnabled()) {
              if (mcWrapper.getHandleCount() != 0) {
                  // Issue warning that Connections have not been closed by the end of the current UOW
                  //  scope and will be closed by the CM.
                  //            Tr.warning(this, tc,"HANDLE_NOT_CLOSED_J2CA0055");
                  Tr.debug(this, tc, "Information:  handle not closed at end of UOW. Connection from pool " + mcWrapper.gConfigProps.getXpathId());
              }
          }
  
          // Do NOT catch the runtime exception which getConnectionManager might throw.
          // If this is thrown it is an internal bug and needs to be fixed.
          // Allow the rte to flow up to the container.
          boolean shareable = mcWrapper.getConnectionManager().shareable();
  
          //  - Simplified the following if/else construct taking advantage of the
          //             new releaseToPoolManger call on mcWrapper.
          //
          // If the connection is shareable, or it is non-shareable and the handleCount is
          // zero, then release it back to the poolManger, otherwise simply reset the
          // transaction related variables.
          //
          // Note: shareable connections are released at the end of transactions regardless of
          //  outstanding handles because we don't supports handled being associated to an active
          //  managedConnection outside of a sharing boundary.
          //
          //  if the MCWrapper is stale we will release the connection to the pool.
          //
          if ((shareable) || (!shareable && mcWrapper.getHandleCount() == 0) || mcWrapper.isStale()) {
  
              if (tc.isDebugEnabled()) {
                  Tr.debug(this, tc,
                           "Releasing the connection to the pool. shareable = " + shareable + "  handleCount = " + mcWrapper.getHandleCount() + "  isStale = " + mcWrapper.isStale());
              }
  
              try {
                  mcWrapper.releaseToPoolManager();
              } catch (Exception e) {
                  // No need to rethrow this exception since nothing can be done about it,
                  //  and the application has successfully finished its use of the connection.
                  com.ibm.ws.ffdc.FFDCFilter.processException(
                                                              e,
                                                              "com.ibm.ejs.j2c.LocalTransactionWrapper.afterCompletion",
                                                              "711",
                                                              this);
                  if (tc.isDebugEnabled()) {
                      Tr.debug(this, tc, "afterCompletionCode for datasource " + mcWrapper.gConfigProps.cfName + ":  caught Exception", e);
                  }
              }
  
          } // end ((shareable) || (!shareable && mcWrapper.getHandleCount() == 0))
          else {
              /*
               * The cleanup of the coordinator enlisted flag should only be done for non sharable connections, in
               * other cases, the coord is set to null in mcWrapper.releaseToPoolManager(). We only need to worry about this
               * if the handleCount is greater than 0 (in which case the cleanup will be done by the poolManager). Same
               * thing for the tranFailed flag in the MCWrapper.
               */
              mcWrapper.setUOWCoordinator(null);
              // Reset the serialReuseCount since it is only valid for the duration of
              // the LTC. Note that the release path above will also reset it via mcWrapper.cleanup().
              enlisted = false;
          }
  
          if (tc.isEntryEnabled()) {
              Tr.exit(this, tc, "afterCompletion");
          }
      }