ILIAS  release_8 Revision v8.25-1-g13de6a5eca6
ilAtomQueryTransaction Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilAtomQueryTransaction:
+ Collaboration diagram for ilAtomQueryTransaction:

Public Member Functions

 run ()
 Fire your Queries. More...
 
- Public Member Functions inherited from ilAtomQueryBase
 __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)
 
- Public Member Functions inherited from ilAtomQuery
 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...
 

Protected Member Functions

 runWithTransactions ()
 
- Protected Member Functions inherited from ilAtomQueryBase
 getDeterminedLockLevel ()
 
 checkQueries ()
 
 hasWriteLocks ()
 
 runQueries ()
 
 checkBeforeRun ()
 

Additional Inherited Members

- Static Public Member Functions inherited from ilAtomQueryBase
static isThereRiskThat (int $isolation_level, int $anomaly)
 
static getPossibleAnomalies (int $isolation_level)
 
static checkIsolationLevel (int $isolation_level)
 
static checkAnomaly (int $anomaly)
 
- Static Public Member Functions inherited from ilAtomQuery
static checkIsolationLevel (int $isolation_level)
 
- Data Fields inherited from ilAtomQuery
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
 
- Protected Attributes inherited from ilAtomQueryBase
const ITERATIONS = 10
 
int $isolation_level = ilAtomQuery::ISOLATION_SERIALIZABLE
 
array $tables = array()
 
 $query
 
ilDBInterface $ilDBInstance
 
- Static Protected Attributes inherited from ilAtomQueryBase
static array $available_isolations_levels
 
static array $possible_anomalies
 
static array $anomalies_map
 

Detailed Description

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 ilAtomQueryTransaction

Author
Fabian Schmid fs@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch
    Implements Atom-Queries with Transactions, currently used in ilDbPdoGalery

Definition at line 28 of file class.ilAtomQueryTransaction.php.

Member Function Documentation

◆ run()

ilAtomQueryTransaction::run ( )

Fire your Queries.

Exceptions

ilAtomQueryException

Reimplemented from ilAtomQueryBase.

Definition at line 35 of file class.ilAtomQueryTransaction.php.

References ilAtomQueryBase\checkBeforeRun(), and runWithTransactions().

+ Here is the call graph for this function:

◆ runWithTransactions()

ilAtomQueryTransaction::runWithTransactions ( )
protected
Exceptions

ilAtomQueryException

Definition at line 45 of file class.ilAtomQueryTransaction.php.

45 : void
46 {
47 $i = 0;
48 do {
49 $e = null;
50 try {
51 $this->ilDBInstance->beginTransaction();
52 $this->runQueries();
53 $this->ilDBInstance->commit();
54 } catch (ilDatabaseException $e) {
55 $this->ilDBInstance->rollback();
56 if ($i >= self::ITERATIONS - 1) {
57 throw $e;
58 }
59 }
60 $i++;
61 } while ($e instanceof ilDatabaseException);
62 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$i
Definition: metadata.php:41

References Vendor\Package\$e, $i, and ilAtomQueryBase\runQueries().

Referenced by run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

The documentation for this class was generated from the following file: