2 require_once(
'./Services/Database/interfaces/interface.ilAtomQuery.php');
3 require_once(
'./Services/Database/classes/Atom/class.ilTableLock.php');
106 $ilTableLock =
new ilTableLock($table_name, $this->ilDBInstance);
108 $this->tables[] = $ilTableLock;
176 abstract public function run();
196 static::checkAnomaly($anomaly);
238 if (!in_array($anomalie, self::$possible_anomalies)) {
248 if (count($this->query) == 0) {
251 foreach ($this->query as
$query) {
264 if (!is_callable($query)) {
267 if (is_array($query)) {
270 if (is_string($query)) {
273 $classname = get_class($query);
274 $is_a_closure = $classname ==
'Closure';
275 if (!$is_a_closure) {
276 $ref =
new ReflectionClass($query);
277 foreach ($ref->getMethods() as $method) {
278 if ($method->getName() ==
'__invoke') {
286 $ref =
new ReflectionFunction($query);
287 $parameters = $ref->getParameters();
288 if (count($parameters) !== 1) {
291 $reflectionClass = $parameters[0]->getClass();
292 if ($reflectionClass && $reflectionClass->getName() ==
'ilDBInterface') {
306 protected function hasWriteLocks() {
307 $has_write_locks =
false;
311 foreach ($this->tables as $table) {
313 $has_write_locks =
true;
317 return $has_write_locks;
326 $query($this->ilDBInstance);
340 if (count($this->tables) === 0) {
const DB_ATOM_CLOSURE_NONE
static $possible_anomalies
const ISOLATION_SERIALIZABLE
const ANO_NON_REPEATED_READ
static checkAnomaly($anomalie)
const DB_ATOM_LOCK_WRONG_LEVEL
const ISOLATION_READ_COMMITED
const ISOLATION_REPEATED_READ
static $available_isolations_levels
const DB_ATOM_CLOSURE_WRONG_FORMAT
addQueryCallable(callable $query)
All action on the database during this isolation has to be passed as Callable to ilAtomQuery.
Class ilAtomQueryException.
const DB_ATOM_CLOSURE_ALREADY_SET
const DB_ATOM_ISO_WRONG_LEVEL
const DB_ATOM_LOCK_NO_TABLE
Create styles array
The data for the language used.
const DB_ATOM_ANO_NOT_AVAILABLE
addTableLock($table_name)
Add table-names which are influenced by your queries, MyISAm has to lock those tables.
checkCallable(callable $query)
static getPossibleAnomalies($isolation_level)
const ISOLATION_READ_UNCOMMITED
static checkIsolationLevel($isolation_level)
static isThereRiskThat($isolation_level, $anomaly)
replaceQueryCallable(callable $query)
__construct(ilDBInterface $ilDBInstance, $isolation_level=ilAtomQuery::ISOLATION_SERIALIZABLE)
ilAtomQuery constructor.