ILIAS
release_5-2 Revision v5.2.25-18-g3f80b828510
|
Interface ilAtomQuery. More...
Public Member Functions | |
addTableLock ($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 ($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 12 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());
\Callable | $query |
ilAtomQueryException |
Implemented in ilAtomQueryBase.
ilAtomQuery::addTableLock | ( | $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
$table_name |
Implemented in ilAtomQueryBase.
ilAtomQuery::checkCallable | ( | callable | $query | ) |
Provides a check if your callable is ready to be used in ilAtomQuery.
callable | $query |
Implemented in ilAtomQueryBase.
|
static |
ilAtomQuery::getIsolationLevel | ( | ) |
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());
\Callable | $query |
ilAtomQueryException |
Implemented in ilAtomQueryBase.
ilAtomQuery::run | ( | ) |
Fire your Queries.
Implemented in ilAtomQueryBase, ilAtomQueryLock, and ilAtomQueryTransaction.
const ilAtomQuery::ANO_DIRTY_READ = 2 |
Definition at line 24 of file interface.ilAtomQuery.php.
const ilAtomQuery::ANO_LOST_UPDATES = 1 |
Definition at line 23 of file interface.ilAtomQuery.php.
const ilAtomQuery::ANO_NON_REPEATED_READ = 3 |
Definition at line 25 of file interface.ilAtomQuery.php.
const ilAtomQuery::ANO_PHANTOM = 4 |
Definition at line 26 of file interface.ilAtomQuery.php.
const ilAtomQuery::ISOLATION_READ_COMMITED = 2 |
Definition at line 19 of file interface.ilAtomQuery.php.
Referenced by ilAtomQueryBase\checkIsolationLevel(), and ilDatabaseAtomBaseTest\testReadCommited().
const ilAtomQuery::ISOLATION_READ_UNCOMMITED = 1 |
Definition at line 18 of file interface.ilAtomQuery.php.
Referenced by ilAtomQueryBase\checkIsolationLevel(), and ilDatabaseAtomBaseTest\testReadUncommited().
const ilAtomQuery::ISOLATION_REPEATED_READ = 3 |
Definition at line 20 of file interface.ilAtomQuery.php.
Referenced by ilAtomQueryBase\checkIsolationLevel(), and ilDatabaseAtomBaseTest\testReadRepeatedRead().
const ilAtomQuery::ISOLATION_SERIALIZABLE = 4 |
Definition at line 21 of file interface.ilAtomQuery.php.
Referenced by ilAtomQueryBase\checkBeforeRun(), ilAtomQueryBase\getDeterminedLockLevel(), and ilDatabaseAtomBaseTest\testGetInstance().
const ilAtomQuery::LOCK_READ = 2 |
Definition at line 16 of file interface.ilAtomQuery.php.
Referenced by ilTableLock\check().
const ilAtomQuery::LOCK_WRITE = 1 |
Definition at line 15 of file interface.ilAtomQuery.php.
Referenced by ilTableLock\check(), ilAtomQueryBase\checkCallable(), ilAtomQueryBase\getDeterminedLockLevel(), ilDatabaseAtomRunTest\getTableLocksForDbInterface(), and ilDatabaseAtomRunTest\testUpdateDuringLock().