docs: public void begin() throws ResourceException {
          if (tc.isEntryEnabled())
              Tr.entry(this, tc, "begin", 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, "begin", "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(" BEGIN");
  
                  Tr.debug(this, tc, stbuf.toString());
              }
          }
  
          ResourceException re;
  
          // Remove synchronization. 
  
          re = ivStateManager.isValid(WSStateManager.LT_BEGIN);
  
          if (re == null) {
              //Note the MC handles all notification of connection error event and such on setAutoCommit
              // also, it sets it only when necessary
  
              try {
                  if (ivMC.getAutoCommit())
                      ivMC.setAutoCommit(false);
              } catch (SQLException sqle) {
                  FFDCFilter.processException(
                                              sqle,
                                              currClass.getName() + ".begin",
                                              "126",
                                              this);
  
                  throw new DataStoreAdapterException(
                                  "DSA_ERROR",
                                  sqle,
                                  currClass);
              }
  
              //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
              // We already validated the state in this sync block, so just set it. 
              ivStateManager.transtate = WSStateManager.LOCAL_TRANSACTION_ACTIVE;
          } else 
          {
              // state change was not valid         
  
              LocalTransactionException local_tran_excep =
                              new LocalTransactionException(re.getMessage());
  
              DataStoreAdapterException dsae = new DataStoreAdapterException(
                                              "WS_INTERNAL_ERROR",
                                              local_tran_excep,
                                              currClass,
                                              "Cannot start SPI local transaction.",
                                              "",
                                              local_tran_excep.getMessage());
  
              // Use FFDC to log the possible components list. 
              FFDCFilter.processException(
                                          dsae,
                                          "com.ibm.ws.rsadapter.spi.WSRdbSpiLocalTransactionImpl.begin",
                                          "127",
                                          this,
                                          new Object[] { "Possible components: WebSphere J2C Implementation" });
              if (tc.isEntryEnabled())
                  Tr.exit(this, tc, "begin", "Exception"); 
              throw dsae;
          }
  
          if (tc.isEventEnabled())
              Tr.event(
                       tc,
                       "SpiLocalTransaction started.  ManagedConnection state is "
                                       + ivMC.getTransactionStateAsString());
  
          if (tc.isEntryEnabled())
              Tr.exit(this, tc, "begin");
      }