docs: public void commit() throws ResourceException {
          if (tc.isEntryEnabled())
              Tr.entry(this, tc, "commit", ivMC);
  
          // if the MC marked Stale, it means the user requested a purge pool with an immediate option
          // so don't allow any work on the mc
          if (ivMC._mcStale) {
              if (tc.isDebugEnabled())
                  Tr.debug(this, tc, "MC is stale");
              throw new DataStoreAdapterException("INVALID_CONNECTION", AdapterUtil.staleX(), WSRdbSpiLocalTransactionImpl.class);
          }
  
          if (dsConfig.get().enableMultithreadedAccessDetection) 
              ivMC.detectMultithreadedAccess(); 
  
          if (!ivMC.isTransactional()) { // do nothing if no enlistment
              if (tc.isEntryEnabled())
                  Tr.exit(this, tc, "commit", "no-op.  Enlistment disabled");
              return;
          }
  
          if (tc.isDebugEnabled()) {
              String cId = null;
              try {
                  cId = ivMC.mcf.getCorrelator(ivMC); 
              } catch (SQLException x) {
                  // will just log the exception here and ignore it since its in trace
                  Tr.debug(
                           tc,
                           "got an exception trying to get the correlator, exception is: ",
                           x);
              }
  
              if (cId != null) {
                  StringBuffer stbuf = new StringBuffer(200);
                  stbuf.append("Correlator: DB2, ID: ");
                  stbuf.append(cId);
                  stbuf.append(" Transaction : ");
                  stbuf.append(this);
                  stbuf.append(" COMMIT");
  
                  Tr.debug(this, tc, stbuf.toString());
              }
          }
  
          ResourceException re = ivStateManager.isValid(WSStateManager.LT_COMMIT);
  
          if (re == null)
              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.  
  
                  //  here the autocommit is always false, so we can call commit.
                  ivConnection.commit();
  
                  //Note this exception is not caught - This is because
                  //  1)  it is of type ResourceException so it can be thrown from the method
                  //  2)  if isValid is okay, this should never fail.  If isValid is not okay
                  //     an exception is thrown from there
                  // Already validated the state in this sync block, so just set it. 
                  ivStateManager.transtate = WSStateManager.NO_TRANSACTION_ACTIVE;
              } 
              catch (SQLException se) {
                  FFDCFilter.processException(
                                              se,
                                              "com.ibm.ws.rsadapter.spi.WSRdbSpiLocalTransactionImpl.commit",
                                              "139",
                                              this);
                  ResourceException x = AdapterUtil.translateSQLException(se, ivMC, true, currClass);
                  if (tc.isEntryEnabled())
                      Tr.exit(this, tc, "commit", "Exception");
                  throw x;
              }
          else 
          {
              // state change was not valid         
  
              LocalTransactionException local_tran_excep =
                              new LocalTransactionException(re.getMessage());
              DataStoreAdapterException ds = new DataStoreAdapterException(
                                              "WS_INTERNAL_ERROR",
                                              local_tran_excep,
                                              currClass,
                                              "Cannot commit SPI local transaction.",
                                              "",
                                              local_tran_excep.getMessage());
              if (tc.isEntryEnabled())
                  Tr.exit(this, tc, "commit", "Exception");
              throw ds;
          }
  
          // Reset so we can deferred enlist in a future global transaction. 
          ivMC.wasLazilyEnlistedInGlobalTran = false; 
  
          if (tc.isEventEnabled())
              Tr.event(
                       tc,
                       "SPILocalTransaction committed. ManagedConnection state is "
                                       + ivMC.getTransactionStateAsString());
  
          if (tc.isEntryEnabled())
              Tr.exit(this, tc, "commit");
      }