docs: void complete(boolean commit) throws CSIException
      {
          final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
  
          if (isTraceOn && tc.isEntryEnabled())
          {
              Tr.entry(tc, "complete called with commit argument set to: " + commit);
          }
  
          if (ivPopContexts != null)
          {
              if (ivPopContexts == Contexts.All)
              {
                  ivThreadData.popContexts();
              }
              else
              {
                  ivThreadData.popCallbackBeanO(); // d630940
              }
  
              ivThreadData.ivLifecycleContextData = ivSavedLifecycleContextData; // d644886
              ivThreadData.ivLifecycleMethodContextIndex = ivSavedLifecycleMethodContextIndex; // d644886
              ivThreadData.ivLifecycleMethodBeginTx = ivSavedLifecycleMethodBeginTx;
              ivThreadData = null;
          }
  
          try
          {
              // This duplicates logic from TranStrategy.
  
              // Complete the UOW started by the begin method.
              if (ivTransactionManager != null) {
                  if (commit) {
                      if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
                          Tr.event(tc, "Committing TX cntxt: " + ivTransactionManager.getTransaction());
  
                      // Was the transaction marked for rollback?
                      int status = ivTransactionManager.getStatus();
                      if (status == Status.STATUS_MARKED_ROLLBACK ||
                          status == Status.STATUS_ROLLING_BACK ||
                          status == Status.STATUS_ROLLEDBACK) {
                          // If the transaction was marked for rollback because it
                          // timed out, then rollback and rethrow the timeout.
                          try {
                              ivTransactionManager.completeTxTimeout();
                          } catch (TransactionRolledbackException e) {
                              ivTransactionManager.rollback();
                              throw e;
                          }
  
                          // Otherwise, rollback silently.
                          ivTransactionManager.rollback();
                      } else {
                          ivTransactionManager.commit();
                      }
                  } else {
                      if (isTraceOn && tc.isEventEnabled()) {
                          Tr.event(tc, "Rolling back TX cntxt due to bean exception: " +
                                       ivTransactionManager.getTransaction());
                      }
                      ivTransactionManager.rollback();
                  }
              } else if (ivLocalTransactionCurrent != null) {
                  int endMode = (commit)
                                  ? LocalTransactionCurrent.EndModeCommit
                                  : LocalTransactionCurrent.EndModeRollBack;
  
                  if (isTraceOn && tc.isEventEnabled()) {
                      LocalTransactionCoordinator lCoord = ivLocalTransactionCurrent.getLocalTranCoord();
                      if (lCoord != null)
                          Tr.event(tc, "Completing LTC cntxt: tid=" +
                                       Integer.toHexString(lCoord.hashCode()) + "(LTC)");
                      else
                          Tr.event(tc, "Completing LTC cntxt: " + "null Coordinator!");
                  }
  
                  ivLocalTransactionCurrent.complete(endMode);
              }
          } catch (Throwable t)
          {
              //FFDCFilter.processException( t, CLASS_NAME + ".complete", "168", this );
              if (isTraceOn && tc.isDebugEnabled())
              {
                  Tr.debug(tc, "unspecified UOW completion failure: " + t, t);
              }
              throw new CSIException("unspecified UOW completion failure: " + t, t);
          } finally
          {
              // Ensure suspended UOW is resumed.
              if (ivUowToken != null)
              {
                  if (isTraceOn)
                  {
                      if (tc.isDebugEnabled())
                          Tr.debug(tc, "complete is resuming UOW with UOWToken = " + ivUowToken);
                      if (tc.isEventEnabled())
                          Tr.event(tc, "Resuming TX/LTC cntxt: " + ivUowToken);
                  }
                  UOWToken token = ivUowToken;
                  ivUowToken = null;
  
                  try {
                      ivBeanO.container.ivUOWManager.resume(token); // d578360
                  } catch (SystemException e) {
                      FFDCFilter.processException(e, CLASS_NAME + ".complete", "216", this);
  
                      throw new CSIException("Cannot complete due to failure in resume.", e);
                  }
  
              }
          }
  
          if (isTraceOn && tc.isEntryEnabled())
          {
              Tr.exit(tc, "complete");
          }
      }