Make sure a connection is in autocommit mode.
509703
def _set_autocommit(connection):
        """"""
        if hasattr(connection.connection, "autocommit"):
            if callable(connection.connection.autocommit):
                connection.connection.autocommit(True)
            else:
                connection.connection.autocommit = True
        elif hasattr(connection.connection, "set_isolation_level"):
            connection.connection.set_isolation_level(0)
987531
protected function beginTransaction($autoCommit = false): void
    {
        if (!$autoCommit && null !== $this->connection) {
            $this->connection->beginTransaction();
        }
    }
1220794
def commit(self, sql=None):
        """"""
        self._transaction = False
        try:
            commit = self._con.commit
        except AttributeError:
            return self._con.query(sql or 'commit')
        else:
            if sql:
                return commit(sql=sql)
            else:
                return commit()
679256
synchronized void prepareCommit(Session session) {

        RowActionBase action = this;

        do {
            if (action.session == session && action.commitTimestamp == 0) {
                action.prepared = true;
            }

            action = action.next;
        } while (action != null);
    }
1010585
def auto():
	""""""
	try:
		Style.enabled = False
		Style.enabled = sys.stdout.isatty()
	except (AttributeError, TypeError):
		pass
1253589
public void setAutoCommit(final String dataSourceName, final boolean autoCommit) {
		Map<String, String> props = getConnPropsByDataSourceName(dataSourceName);
		props.put(PROPS_AUTO_COMMIT, Boolean.toString(autoCommit));
	}
1264914
def forcecommit(self):
        '''
        
        '''
        if not self.dirty:
            return False

        # ok... lets commit and re-open
        self._finiCoXact()
        self._initCoXact()
        return True
740748
public function begin(): void
  {
    $ret = $this->mysqli->autocommit(false);
    if (!$ret) $this->mySqlError('mysqli::autocommit');
  }
556119
def commit(self):
        """"""
        if self._transaction_nesting_level == 0:
            raise DBALConnectionError.no_active_transaction()
        if self._is_rollback_only:
            raise DBALConnectionError.commit_failed_rollback_only()

        self.ensure_connected()
        if self._transaction_nesting_level == 1:
            self._driver.commit()
        elif self._nest_transactions_with_savepoints:
            self.release_savepoint(self._get_nested_transaction_savepoint_name())

        self._transaction_nesting_level -= 1

        if not self._auto_commit and self._transaction_nesting_level == 0:
            self.begin_transaction()
813798
def check (self):
        """"""
        if self.aggregate.config["trace"]:
            trace.trace_on()
        try:
            self.local_check()
        except (socket.error, select.error):
            # on Unix, ctrl-c can raise
            # error: (4, 'Interrupted system call')
            etype, value = sys.exc_info()[:2]
            if etype == errno.EINTR:
                raise KeyboardInterrupt(value)
            else:
                raise
560271
public static function begin(): void
  {
    $ret = self::$mysqli->autocommit(false);
    if (!$ret) self::mySqlError('mysqli::autocommit');
  }
596611
public function startTransaction()
    {
        # Ensure we have a connection to start the transaction on
        $this->connect();

        switch ($this->mode) {

            case "mysql":
                $result = $this->server->autocommit(false);
                break;

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

            case "redshift":
                $result = $this->query("START TRANSACTION");
                break;

            case "odbc":
                $result = odbc_autocommit($this->server, false);
                break;

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

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

        $this->transaction = true;

        return true;
    }
286088
def commit(self):
		
		try:
			if self.connection is not None:
				self.connection.commit()
				self._updateCheckTime()
				self.release()
		except Exception, e:
			pass
1309114
def _ExecuteTransaction(self, transaction):
    """"""

    def Action(connection):
      connection.cursor.execute("START TRANSACTION")
      for query in transaction:
        connection.cursor.execute(query["query"], query["args"])
      connection.cursor.execute("COMMIT")
      return connection.cursor.fetchall()

    return self._RetryWrapper(Action)
1103713
public static final void commit(final Connection connection) {
        if (connection == null) {
            return;
        }

        try {
            connection.commit();
        } catch (Exception e) {
            if (LOG.isWarnEnabled()) LOG.warn("Error committing Connection: " + connection, e);
        }
    }
382330
protected void restoreAutoCommitState()
    {
        try
        {
            if(!broker.isManaged())
            {
                if (jcd.getUseAutoCommit() == JdbcConnectionDescriptor.AUTO_COMMIT_SET_TRUE_AND_TEMPORARY_FALSE
                        && originalAutoCommitState == true && con != null && !con.isClosed())
                {
                    platform.changeAutoCommitState(jcd, con, true);
                }
            }
            else
            {
                if(log.isDebugEnabled()) log.debug(
                        "Found managed environment setting in PB, will skip Platform.changeAutoCommitState(...) call");
            }
        }
        catch (SQLException e)
        {
            // should never be reached
            throw new OJBRuntimeException("Restore of connection autocommit state failed", e);
        }
    }
141749
private function handleAutoCommit(): bool {
        $diff = count($this->indexedRes) - count($this->commitedRes);
        if ($diff >= $this->autoCommit && $this->autoCommit > 0) {
            echo self::$debug ? " + autocommit" : '';
            $this->fedora->commit();
            $this->commitedRes = $this->indexedRes;
            $this->fedora->begin();
            return true;
        }
        return false;
    }