ILIAS
release_8 Revision v8.19-1-g4e8f2f9140c
|
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...
Public Member Functions | |
__construct (ilDBInterface $ilDBInstance, int $isolation_level=ilAtomQuery::ISOLATION_SERIALIZABLE) | |
ilAtomQuery constructor. More... | |
getRisks () | |
addTableLock (string $table_name) | |
Add table-names which are influenced by your queries, MyISAm has to lock those tables. More... | |
addQueryCallable (callable $query) | |
All action on the database during this isolation has to be passed as Callable to ilAtomQuery. More... | |
replaceQueryCallable (callable $query) | |
run () | |
Fire your Queries. More... | |
getIsolationLevel () | |
checkCallable (callable $query) | |
Static Public Member Functions | |
static | isThereRiskThat (int $isolation_level, int $anomaly) |
static | getPossibleAnomalies (int $isolation_level) |
static | checkIsolationLevel (int $isolation_level) |
static | checkAnomaly (int $anomaly) |
Protected Member Functions | |
getDeterminedLockLevel () | |
checkQueries () | |
hasWriteLocks () | |
runQueries () | |
checkBeforeRun () | |
Protected Attributes | |
const | ITERATIONS = 10 |
int | $isolation_level = ilAtomQuery::ISOLATION_SERIALIZABLE |
array | $tables = array() |
$query | |
ilDBInterface | $ilDBInstance |
Static Protected Attributes | |
static array | $available_isolations_levels |
static array | $possible_anomalies |
static array | $anomalies_map |
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.
ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.
If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Class 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 class.ilAtomQueryBase.php.
ilAtomQueryBase::__construct | ( | ilDBInterface | $ilDBInstance, |
int | $isolation_level = ilAtomQuery::ISOLATION_SERIALIZABLE |
||
) |
ilAtomQuery constructor.
int | $isolation_level | currently only ISOLATION_SERIALIZABLE is available |
Definition at line 82 of file class.ilAtomQueryBase.php.
References $ilDBInstance, and $isolation_level.
ilAtomQueryBase::addQueryCallable | ( | callable | $query | ) |
All 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 |
Definition at line 135 of file class.ilAtomQueryBase.php.
References $query, checkCallable(), ilAtomQueryException\DB_ATOM_CLOSURE_ALREADY_SET, and ilAtomQueryException\DB_ATOM_CLOSURE_WRONG_FORMAT.
ilAtomQueryBase::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
Definition at line 106 of file class.ilAtomQueryBase.php.
References getDeterminedLockLevel().
|
static |
Definition at line 211 of file class.ilAtomQueryBase.php.
References ilAtomQueryException\DB_ATOM_ANO_NOT_AVAILABLE.
|
protected |
Definition at line 294 of file class.ilAtomQueryBase.php.
References checkQueries(), ilAtomQueryException\DB_ATOM_LOCK_NO_TABLE, ilAtomQueryException\DB_ATOM_LOCK_WRONG_LEVEL, getIsolationLevel(), hasWriteLocks(), and ilAtomQuery\ISOLATION_SERIALIZABLE.
Referenced by ilAtomQueryTransaction\run(), and ilAtomQueryLock\run().
ilAtomQueryBase::checkCallable | ( | callable | $query | ) |
Definition at line 234 of file class.ilAtomQueryBase.php.
Referenced by addQueryCallable(), checkQueries(), and replaceQueryCallable().
|
static |
Definition at line 192 of file class.ilAtomQueryBase.php.
References ilAtomQueryException\DB_ATOM_ISO_WRONG_LEVEL, ilAtomQuery\ISOLATION_READ_COMMITED, ilAtomQuery\ISOLATION_READ_UNCOMMITED, and ilAtomQuery\ISOLATION_REPEATED_READ.
|
protected |
Definition at line 221 of file class.ilAtomQueryBase.php.
References $query, checkCallable(), ilAtomQueryException\DB_ATOM_CLOSURE_NONE, and ilAtomQueryException\DB_ATOM_CLOSURE_WRONG_FORMAT.
Referenced by checkBeforeRun().
|
protected |
Definition at line 115 of file class.ilAtomQueryBase.php.
References ilAtomQuery\LOCK_WRITE.
Referenced by addTableLock().
ilAtomQueryBase::getIsolationLevel | ( | ) |
Definition at line 163 of file class.ilAtomQueryBase.php.
References $isolation_level.
Referenced by checkBeforeRun(), and getRisks().
|
static |
ilAtomQueryBase::getRisks | ( | ) |
Definition at line 95 of file class.ilAtomQueryBase.php.
References getIsolationLevel().
|
protected |
Definition at line 270 of file class.ilAtomQueryBase.php.
References ilAtomQuery\LOCK_WRITE.
Referenced by checkBeforeRun().
|
static |
ilAtomQueryBase::replaceQueryCallable | ( | callable | $query | ) |
Definition at line 149 of file class.ilAtomQueryBase.php.
References $query, checkCallable(), ilAtomQueryException\DB_ATOM_CLOSURE_WRONG_FORMAT, and run().
|
abstract |
Fire your Queries.
Referenced by replaceQueryCallable().
|
protected |
ilAtomQueryException |
Definition at line 285 of file class.ilAtomQueryBase.php.
References $query.
Referenced by ilAtomQueryLock\runWithLocks(), and ilAtomQueryTransaction\runWithTransactions().
|
staticprotected |
Definition at line 51 of file class.ilAtomQueryBase.php.
|
staticprotected |
Definition at line 33 of file class.ilAtomQueryBase.php.
|
protected |
Definition at line 76 of file class.ilAtomQueryBase.php.
Referenced by __construct().
|
protected |
Definition at line 67 of file class.ilAtomQueryBase.php.
Referenced by __construct(), getIsolationLevel(), and getPossibleAnomalies().
|
staticprotected |
Definition at line 42 of file class.ilAtomQueryBase.php.
|
protected |
Definition at line 75 of file class.ilAtomQueryBase.php.
Referenced by addQueryCallable(), checkQueries(), replaceQueryCallable(), and runQueries().
|
protected |
Definition at line 71 of file class.ilAtomQueryBase.php.
|
protected |
Definition at line 29 of file class.ilAtomQueryBase.php.