ILIAS
trunk Revision v11.0_alpha-1749-g1a06bdef097
|
Interface ilAtomQuery Use ilAtomQuery to fire Database-Actions which have to be done without beeing influenced by other queries or which can influence other queries as well. More...
Public Member Functions | |
addTableLock (string $table_name) | |
Add table-names which are influenced by your queries, MyISAm has to lock those tables. More... | |
addQueryCallable (callable $query) | |
Every action on the database during this isolation has to be passed as Callable to ilAtomQuery. More... | |
replaceQueryCallable (callable $query) | |
Every action on the database during this isolation has to be passed as Callable to ilAtomQuery. More... | |
run () | |
Fire your Queries. More... | |
getIsolationLevel () | |
Returns the current Isolation-Level. More... | |
checkCallable (callable $query) | |
Provides a check if your callable is ready to be used in ilAtomQuery. More... | |
Static Public Member Functions | |
static | checkIsolationLevel (int $isolation_level) |
Data Fields | |
const | LOCK_WRITE = 1 |
const | LOCK_READ = 2 |
const | ISOLATION_READ_UNCOMMITED = 1 |
const | ISOLATION_READ_COMMITED = 2 |
const | ISOLATION_REPEATED_READ = 3 |
const | ISOLATION_SERIALIZABLE = 4 |
const | ANO_LOST_UPDATES = 1 |
const | ANO_DIRTY_READ = 2 |
const | ANO_NON_REPEATED_READ = 3 |
const | ANO_PHANTOM = 4 |
Interface ilAtomQuery Use ilAtomQuery to fire Database-Actions which have to be done without beeing influenced by other queries or which can influence other queries as well.
Depending on the current Database-engine, this can be done by using transaction or with table-locks
Definition at line 27 of file interface.ilAtomQuery.php.
ilAtomQuery::addQueryCallable | ( | callable | $query | ) |
Every action on the database during this isolation has to be passed as Callable to ilAtomQuery.
An example (Closure): $ilAtomQuery->addQueryClosure( function (ilDBInterface $ilDB) use ($new_obj_id, $current_id) { $ilDB->doStuff(); }); An example (Callable Class): class ilMyAtomQueryClass { public function __invoke(ilDBInterface $ilDB) { $ilDB->doStuff(); } } $ilAtomQuery->addQueryClosure(new ilMyAtomQueryClass());
ilAtomQueryException |
ilAtomQuery::addTableLock | ( | string | $table_name | ) |
Add table-names which are influenced by your queries, MyISAm has to lock those tables.
You get an ilTableLockInterface with further possibilities, e.g.: $ilAtomQuery->addTableLock('my_table')->lockSequence(true)->aliasName('my_alias'); the lock-level is determined by ilAtomQuery
ilAtomQuery::checkCallable | ( | callable | $query | ) |
Provides a check if your callable is ready to be used in ilAtomQuery.
|
static |
ilAtomQuery::getIsolationLevel | ( | ) |
Returns the current Isolation-Level.
ilAtomQuery::replaceQueryCallable | ( | callable | $query | ) |
Every action on the database during this isolation has to be passed as Callable to ilAtomQuery.
An example (Closure): $ilAtomQuery->addQueryClosure( function (ilDBInterface $ilDB) use ($new_obj_id, $current_id) { $ilDB->doStuff(); }); An example (Callable Class): class ilMyAtomQueryClass { public function __invoke(ilDBInterface $ilDB) { $ilDB->doStuff(); } } $ilAtomQuery->addQueryClosure(new ilMyAtomQueryClass());
ilAtomQueryException |
ilAtomQuery::run | ( | ) |
const ilAtomQuery::ANO_DIRTY_READ = 2 |
Definition at line 39 of file interface.ilAtomQuery.php.
const ilAtomQuery::ANO_LOST_UPDATES = 1 |
Definition at line 38 of file interface.ilAtomQuery.php.
const ilAtomQuery::ANO_NON_REPEATED_READ = 3 |
Definition at line 40 of file interface.ilAtomQuery.php.
const ilAtomQuery::ANO_PHANTOM = 4 |
Definition at line 41 of file interface.ilAtomQuery.php.
const ilAtomQuery::ISOLATION_READ_COMMITED = 2 |
Definition at line 34 of file interface.ilAtomQuery.php.
const ilAtomQuery::ISOLATION_READ_UNCOMMITED = 1 |
Definition at line 33 of file interface.ilAtomQuery.php.
Referenced by ilAtomQueryBase\checkIsolationLevel().
const ilAtomQuery::ISOLATION_REPEATED_READ = 3 |
Definition at line 35 of file interface.ilAtomQuery.php.
const ilAtomQuery::ISOLATION_SERIALIZABLE = 4 |
Definition at line 36 of file interface.ilAtomQuery.php.
const ilAtomQuery::LOCK_READ = 2 |
Definition at line 31 of file interface.ilAtomQuery.php.
Referenced by ilTableLock\check().
const ilAtomQuery::LOCK_WRITE = 1 |
Definition at line 30 of file interface.ilAtomQuery.php.
Referenced by ilTableLock\check(), ilAtomQueryBase\getDeterminedLockLevel(), and ilAtomQueryBase\hasWriteLocks().