Execute all updates and deletes using synchronous statements.
14357
private void executeUpdatesSynchronous(DBTransaction transaction) {
        BatchStatement batchState = new BatchStatement(Type.UNLOGGED);
        batchState.addAll(getMutations(transaction));
        executeBatch(batchState);
    }
640443
def flush_all(self, conn):
        """"""
        command = b'flush_all\r\n'
        response = yield from self._execute_simple_command(
            conn, command)

        if const.OK != response:
            raise ClientException('Memcached flush_all failed', response)
13413
private void executeUpdatesAsynchronous(DBTransaction transaction) {
        Collection<BoundStatement> mutations = getMutations(transaction);
        List<ResultSetFuture> futureList = new ArrayList<>(mutations.size());
        for(BoundStatement mutation: mutations) {
            ResultSetFuture future = m_dbservice.getSession().executeAsync(mutation);
            futureList.add(future);
        }
        m_logger.debug("Waiting for {} asynchronous futures", futureList.size());
        for (ResultSetFuture future : futureList) {
            future.getUninterruptibly();
        }
    }
1222466
def flushall(self, async_op=False):
        
        if async_op:
            fut = self.execute(b'FLUSHALL', b'ASYNC')
        else:
            fut = self.execute(b'FLUSHALL')
        return wait_ok(fut)
1153274
public function execute() {
        if (!is_enabled_auth('db')) {
            mtrace('auth_db plugin is disabled, synchronisation stopped', 2);
            return;
        }

        $dbauth = get_auth_plugin('db');
        $config = get_config('auth_db');
        $trace = new \text_progress_trace();
        $update = !empty($config->updateusers);
        $dbauth->sync_users($trace, $update);
    }
650434
private void execute(String sql) throws SQLException {
        Statement statement = connection.createStatement();
        try {
            statement.executeUpdate(substitute(sql));
        } finally {
            DbUtils.closeQuietly(statement);
        }
    }
626192
public function execute() {
        global $DB;

        mtrace("\n  Cleaning up old question statistics cache records...", '');

        $expiretime = time() - 5 * HOURSECS;
        $DB->delete_records_select('question_statistics', 'timemodified < ?', [$expiretime]);
        $responseanlysisids = $DB->get_records_select_menu('question_response_analysis',
            'timemodified < ?',
            [$expiretime],
            'id',
            'id, id AS id2');
        $DB->delete_records_list('question_response_analysis', 'id', $responseanlysisids);
        $DB->delete_records_list('question_response_count', 'analysisid', $responseanlysisids);

        mtrace('done.');
    }
174546
public function execute() {
        global $CFG, $DB;

        $timenow = time();
        // Run external blog cron if needed.
        if (!empty($CFG->enableblogs) && $CFG->useexternalblogs) {
            require_once($CFG->dirroot . '/blog/lib.php');
            $sql = "timefetched < ? OR timefetched = 0";
            $externalblogs = $DB->get_records_select('blog_external', $sql, array($timenow - $CFG->externalblogcrontime));

            foreach ($externalblogs as $eb) {
                blog_sync_external_entries($eb);
            }
        }
        // Run blog associations cleanup.
        if (!empty($CFG->enableblogs) && $CFG->useblogassociations) {
            require_once($CFG->dirroot . '/blog/lib.php');
            // Delete entries whose contextids no longer exists.
            $DB->delete_records_select('blog_association', 'contextid NOT IN (SELECT id FROM {context})');
        }

    }
1249775
def execute_sql(self, sql, commit=False):
        """"""
        logger.info("Running sqlite query: \"%s\"", sql)
        self.connection.execute(sql)
        if commit:
            self.connection.commit()
830706
def do_upgrade(self):
        """"""
        sql = text('delete from upgrade where upgrade = :upgrade')
        for upgrade in self.legacy_upgrades:
            db.engine.execute(sql, upgrade=upgrade)
1256881
def execute_transaction(conn, statements: Iterable):
    """"""

    with conn:
        with conn.cursor() as cursor:
            for statement in statements:
                cursor.execute(statement)
        conn.commit()
1066242
private function execute()
    {
        $this->Connect();
        try {
            $this->delete->execute($this->places);
            $this->result = true;
            $this->react = new React("delete", str_replace(PRE, '', $this->tabela), $this->resultsUpdates, $this->resultsUpdates);
        } catch (\PDOException $e) {
            $this->result = null;
            $this->erro = "<b>Erro ao Deletar:</b> {$e->getMessage()}";
        }

        parent::setDefault();
    }
81143
public function execute() {
        global $DB;

        $loglifetime = (int)get_config('logstore_standard', 'loglifetime');

        if (empty($loglifetime) || $loglifetime < 0) {
            return;
        }

        $loglifetime = time() - ($loglifetime * 3600 * 24); // Value in days.
        $lifetimep = array($loglifetime);
        $start = time();

        while ($min = $DB->get_field_select("logstore_standard_log", "MIN(timecreated)", "timecreated < ?", $lifetimep)) {
            // Break this down into chunks to avoid transaction for too long and generally thrashing database.
            // Experiments suggest deleting one day takes up to a few seconds; probably a reasonable chunk size usually.
            // If the cleanup has just been enabled, it might take e.g a month to clean the years of logs.
            $params = array(min($min + 3600 * 24, $loglifetime));
            $DB->delete_records_select("logstore_standard_log", "timecreated < ?", $params);
            if (time() > $start + 300) {
                // Do not churn on log deletion for too long each run.
                break;
            }
        }

        mtrace(" Deleted old log records from standard store.");
    }
828797
public static void execute(Collection<DeleteOp> deleteOps) throws IOException {
        try {
            for (DeleteOp deleteOp : deleteOps) {
                deleteOp.prepare();
            }

            // best effort cleanup - delete what's possible and report error if anything remains
            boolean commitResult = true;
            for (DeleteOp op : deleteOps) {
                commitResult &= op.commit();
            }
            if (!commitResult) {
                throw PatchLogger.ROOT_LOGGER.failedToDeleteBackup();
            }

        } catch (PrepareException pe) {
            for (DeleteOp deleteOp : deleteOps) {
                deleteOp.rollback();
            }

            throw PatchLogger.ROOT_LOGGER.failedToDelete(pe.getPath());
        }

    }
129387
public function execute() {
        global $DB;

        $timenow = time();

        \core\session\manager::gc();

        // Cleanup old session linked tokens.
        // Deletes the session linked tokens that are over a day old.
        $DB->delete_records_select('external_tokens', 'lastaccess < :onedayago AND tokentype = :tokentype',
                        array('onedayago' => $timenow - DAYSECS, 'tokentype' => EXTERNAL_TOKEN_EMBEDDED));
    }
1109701
public void execute(Runnable statements)
	{
		try (HibernateTransaction tx = start().withAutoRollback())
		{
			statements.run();

			// Success, perform a TX commit
			tx.commit();
		}
	}
1315696
public function execute() {
        global $CFG, $DB;

        $timenow = time();

        // Delete users who haven't confirmed within required period.
        if (!empty($CFG->deleteunconfirmed)) {
            $cuttime = $timenow - ($CFG->deleteunconfirmed * 3600);
            $rs = $DB->get_recordset_sql ("SELECT *
                                             FROM {user}
                                            WHERE confirmed = 0 AND timecreated > 0
                                                  AND timecreated < ? AND deleted = 0", array($cuttime));
            foreach ($rs as $user) {
                delete_user($user);
                mtrace(" Deleted unconfirmed user ".fullname($user, true)." ($user->id)");
            }
            $rs->close();
        }
    }