docs: public void commit(Xid xid, boolean onePhase) throws XAException
      {
          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
              Tr.entry(this, tc, "commit", new Object[] 
                       {
                        ivManagedConnection,
                        AdapterUtil.toString(xid), 
                        onePhase ? "ONE PHASE" : "TWO PHASE" }
                              );
  
          if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { 
              String cId = null;
              try {
                  cId = ivManagedConnection.mcf.getCorrelator(ivManagedConnection); 
              } catch (SQLException x) {
                  // will just log the exception here and ignore it since its in trace
                  Tr.debug(this, tc, "got an exception trying to get the correlator in commit, exception is: ", x);
              }
              if (cId != null) {
                  StringBuffer stbuf = new StringBuffer(200);
                  stbuf.append("Correlator: DB2, ID: ");
                  stbuf.append(cId);
                  if (xid != null) {
                      stbuf.append("Transaction ID : ");
                      stbuf.append(xid);
                  }
                  stbuf.append(" COMMIT");
                  Tr.debug(this, tc, stbuf.toString());
              }
          }
  
          if (dsConfig.get().enableMultithreadedAccessDetection) 
              ivManagedConnection.detectMultithreadedAccess(); 
  
          if (!onePhase) {
              XAException xaX = new XAException(XAException.XA_RBPROTO);
              if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                  Tr.exit(this, tc, "commit", xaX); 
              throw xaX;
          }
  
          boolean commitFailed = false;
          boolean rollbackFailed = false;
          boolean setStateFailed = false;
  
          // Reset so we can deferred enlist in a future global transaction. 
          ivManagedConnection.wasLazilyEnlistedInGlobalTran = false; 
  
          try {
              // If no work was done during the transaction, the autoCommit value may still
              // be on.  In this case, just no-op, since some drivers like ConnectJDBC 3.1
              // don't allow commit/rollback when autoCommit is on.  
  
              ivSqlConn.commit(); 
              ivStateManager.setState(WSStateManager.XA_COMMIT);
          } catch (SQLException sqeC)
          {
              FFDCFilter.processException(sqeC, "com.ibm.ws.rsadapter.spi.WSRdbOnePhaseXaResourceImpl.commit", "105", this);
              commitFailed = true;
              Tr.error(tc, "DSA_INTERNAL_ERROR", new Object[] { "Exception caught during commit on the OnePhaseXAResource", sqeC });
  
              // If no work was done during the transaction, the autoCommit value may still
              // be on.  In this case, just no-op, since some drivers like ConnectJDBC 3.1
              // don't allow commit/rollback when autoCommit is on.  
  
              try
              { // autoCommit is off
                  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())  
                      Tr.debug(this, tc, "issue a rollback due to commit failure");
                  ivSqlConn.rollback();
              } catch (SQLException sqeR)
              {
                  FFDCFilter.processException(sqeR, "com.ibm.ws.rsadapter.spi.WSRdbOnePhaseXaResourceImpl.commit", "197", this);
                  rollbackFailed = true;
                  Tr.error(tc, "DSA_INTERNAL_ERROR", new Object[] { "Exception caught during rollback on the OnePhaseXAResource after a commit failed", sqeR });
              }
              catch (java.lang.RuntimeException x)
              {
                  FFDCFilter.processException(x, "com.ibm.ws.rsadapter.spi.WSRdbOnePhaseXaResourceImpl.commit", "204", this);
                  rollbackFailed = true;
                  Tr.error(tc, "DSA_INTERNAL_ERROR", new Object[] { "Exception caught during rollback on the OnePhaseXAResource after a commit failed", x });
              }
  
          } catch (TransactionException te) {
              //Exception means setState failed because it was invalid to set the state in this case
              FFDCFilter.processException(te, "com.ibm.ws.rsadapter.spi.WSRdbOnePhaseXaResourceImpl.commit", "123", this);
              Tr.error(tc, "INVALID_TX_STATE", new Object[] { "OnePhaseXAResource.commit()", ivManagedConnection.getTransactionStateAsString() });
              setStateFailed = false;
  
          }
          catch (java.lang.RuntimeException x)
          {
              FFDCFilter.processException(x, "com.ibm.ws.rsadapter.spi.WSRdbOnePhaseXaResourceImpl.commit", "221", this);
              Tr.error(tc, "DSA_INTERNAL_ERROR", new Object[] { "Exception caught during commit on the OnePhaseXAResource", x });
  
              XAException xae = new XAException(XAException.XA_HEURHAZ); // throwing Heurhaz sine we don't really know f the commit failed or not.             
              traceXAException(xae, currClass);
              if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                  Tr.exit(this, tc, "commit", "Exception"); 
              throw xae;
  
          }
  
          if (rollbackFailed) {
              XAException xae = new XAException(XAException.XAER_RMERR);
              traceXAException(xae, currClass);
              if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                  Tr.exit(this, tc, "commit", "Exception"); 
              throw xae;
          } else if (commitFailed) {
              XAException xae = new XAException(XAException.XA_HEURHAZ); //  we don't know if the commit really failed, or the failure in communication after the commit succeeded             
              traceXAException(xae, currClass);
              if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                  Tr.exit(this, tc, "commit", "Exception"); 
              throw xae;
          } else if (setStateFailed) {
              XAException xae = new XAException(XAException.XAER_RMERR);
              traceXAException(xae, currClass);
              if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                  Tr.exit(this, tc, "commit", "Exception"); 
              throw xae;
          }
  
          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
              Tr.exit(this, tc, "commit"); 
      }