Opens a Transaction and sets auto commission.
@access		public
@param		bool		$autoCommit			Flag for setting auto commission
@return		void
427322
public function start( $autoCommit = 1 )
	{
		$this->openTransactions ++;
		if( $this->openTransactions == 1 )
		{
			if( $autoCommit )
			{
				$query = "SET AUTOCOMMIT=0";
			}
			$this->Execute( $query );
			$query = "START TRANSACTION";
			$this->Execute ($query);
		}
	}
537770
def _send_autocommit_mode(self):
        """"""
        self._execute_command(COMMAND.COM_QUERY, "SET AUTOCOMMIT = %s" %
                              self.escape(self.autocommit_mode))
        self._read_ok_packet()
1095711
public function commitTransaction()
    {
        if (!self::$transaction) {
            throw new TransactionException("There is no Active Transaction");
        }

        self::$transaction = false;
        foreach (self::$connectionList as $dbDriver) {
            $dbDriver->commitTransaction();
        }
    }
1066182
public function endTransaction($commit)
    {
        if ($commit) {
            $result = $this->commit();
        } else {
            $result = $this->rollback();
        }

        switch ($this->mode) {

            case "mysql":
                if (!$this->server->autocommit(true)) {
                    $result = false;
                }
                break;

            case "postgres":
                $result = $this->query("SET AUTOCOMMIT = ON");
                break;

            case "redshift":
                # Do nothing, and use the result from the commit/rollback
                break;

            case "odbc":
                if (!odbc_autocommit($this->server, true)) {
                    $result = false;
                }
                break;

            default:
                throw new \Exception("endTransaction() not supported in this mode (" . $this->mode . ")");
        }

        if (!$result) {
            $this->error();
        }

        $this->transaction = false;

        return true;
    }
711320
public function commit()
	{
		if ( $this->transactionCount < 1 ) {
			return;
		}
		$transaction = $this->unprepared( "COMMIT;" );
		if ( false !== $transaction ) {
			$this->transactionCount --;
		}
	}
1327042
public function beginTransaction(array $options = [])
    {
        if (!$this->isConnected()) {
            $this->connect();
        }
        
        if (!$this->inTransaction() || !empty($options['new'])) {
            $this->workSavepoint(
                'beginTransaction',
                'SAVEPOINT ' . $this->savePointName()
            );
            $this->transactions[] = true;
        } else {
            $this->transactions[] = false;
        }
    }
810851
public function setAutoCommit($autoCommit=true,$queryServer=null)
    {
        if($autoCommit)
            $this->query('SET AUTOCOMMIT=1',$queryServer);
        else
            $this->query('SET AUTOCOMMIT=0',$queryServer);
    }
944910
public function setAutoCloseState($autoCloseState)
    {
        $authorizedValues = [self::AUTO_CLOSED_STATE_CLOSED, self::AUTO_CLOSED_STATE_WAITING];
        if (in_array($autoCloseState, $authorizedValues)) {
            $this->autoCloseState = $autoCloseState;
        }
    }
1360732
public function setAutoCommit($isAutoCommit = false)
    {
        $this->dbh->setAttribute(\PDO::ATTR_AUTOCOMMIT, $isAutoCommit);
        
        return $this;
    }
908788
private function OpenTransaction(){
        if(!$this->transactionActive) {
            $this->beginTransaction();
            $this->exec("SET FOREIGN_KEY_CHECKS = 0;");
            $this->transactionActive = true;
        }
    }
156162
public function startTransaction()
    {

        if (!is_a($this->resourceId, "mysqli")) {
            throw new QueryException("No valid db resource Id found. This is required to start a transaction");
            return false;
        }
        $this->resourceId->autocommit(FALSE); //Turns autocommit off;

    }
1205399
protected function _rollBack()
    {
        $this->_connect();
        $this->_connection->rollback();
        $this->_connection->autocommit(true);
    }
1311388
private static function checkAutocommit(\PDO $pdo): void
    {
        $vendor = $pdo->getAttribute(\PDO::ATTR_DRIVER_NAME);
        
        // MySQL turns autocommit off during a transaction.
        if ($vendor == "mysql") {
            return;
        }

        try {
            if ($pdo->getAttribute(\PDO::ATTR_AUTOCOMMIT)) {
                throw new \InvalidArgumentException("PDO::ATTR_AUTOCOMMIT should be disabled.");
            }
        } catch (\PDOException $e) {
            /*
             * Ignore this, as some drivers would throw an exception for an
             * unsupported attribute (e.g. Postgres).
             */
        }
    }
15331
@Override
    public void setAutoCommit(boolean autoCommit) throws SQLException
    {
        checkClosed();
        // Always true - error out only if the client is trying to set somethign else
        if (!autoCommit && (props.getProperty(COMMIT_THROW_EXCEPTION, "true").equalsIgnoreCase("true"))) {
            throw SQLError.noSupport();
        }
        else {
            this.autoCommit = autoCommit;
        }
    }
1282523
public function transactionStart($asSavepoint = false)
	{
		$this->connect();

		if (!$asSavepoint || !$this->transactionDepth)
		{
			if ($this->setQuery('BEGIN TRANSACTION')->execute())
			{
				$this->transactionDepth = 1;
			}

			return;
		}

		$savepoint = 'SP_' . $this->transactionDepth;
		$this->setQuery('BEGIN TRANSACTION ' . $this->quoteName($savepoint));

		if ($this->execute())
		{
			$this->transactionDepth++;
		}
	}
512117
public function commit($xid)
    {
        if ($this->activeTransaction != $xid || $this->activeTransaction === false) {
            return;
        }

        $this->activeTransaction = false;

        if (!$this->connection->commit()) {
            throw new DbException("Commit failed");
        }

        $this->connection->autocommit(true);
    }
653486
public void setAutoCommit(final boolean autoCommit) throws SQLException {
        Statement stmt = createStatement();
        String clause;

        if(autoCommit) {
            clause = "1";
        } else {
            clause = "0";
        }

        stmt.executeUpdate("set autocommit="+clause);
    }