ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f87
class.ilTestProcessLockerDb.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 require_once 'Modules/Test/classes/class.ilTestProcessLocker.php';
5 
13 {
17  protected $db;
18 
22  public function __construct(ilDB $db)
23  {
24  $this->db = $db;
25  }
26 
28  {
29  $tables = array(
30  array('name' => 'tst_active', 'type' => ilDB::LOCK_WRITE)
31  );
32 
33  $this->db->lockTables($tables);
34  }
35 
37  {
38  $this->db->unlockTables();
39  }
40 
41  public function requestRandomPassBuildLock($withTaxonomyTables = false)
42  {
43  $tables = array();
44 
45  $tables[] = array('name' => 'tst_rnd_cpy', 'type' => ilDB::LOCK_WRITE);
46  $tables[] = array('name' => 'qpl_questions', 'type' => ilDB::LOCK_WRITE);
47  $tables[] = array('name' => 'qpl_qst_type', 'type' => ilDB::LOCK_WRITE);
48  $tables[] = array('name' => 'tst_test_rnd_qst', 'type' => ilDB::LOCK_WRITE);
49  $tables[] = array('name' => 'tst_test_rnd_qst', 'type' => ilDB::LOCK_WRITE, 'sequence' => true);
50  $tables[] = array('name' => 'il_pluginslot', 'type' => ilDB::LOCK_WRITE);
51  $tables[] = array('name' => 'il_plugin', 'type' => ilDB::LOCK_WRITE);
52 
53  if( $withTaxonomyTables )
54  {
55  $tables[] = array('name' => 'tax_tree s', 'type' => ilDB::LOCK_WRITE);
56  $tables[] = array('name' => 'tax_tree t', 'type' => ilDB::LOCK_WRITE);
57  $tables[] = array('name' => 'tax_node_assignment', 'type' => ilDB::LOCK_WRITE);
58  }
59 
60  $this->db->lockTables($tables);
61  }
62 
63  public function releaseRandomPassBuildLock()
64  {
65  $this->db->unlockTables();
66  }
67 }
requestRandomPassBuildLock($withTaxonomyTables=false)
const LOCK_WRITE
Definition: class.ilDB.php:30
Database Wrapper.
Definition: class.ilDB.php:28