ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilAssQuestionProcessLockerDb.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionProcessLocker.php';
5
13{
17 protected $db;
18
19 private $assessmentLogEnabled = false;
20
24 public function __construct(ilDB $db)
25 {
26 $this->db = $db;
27 }
28
29 public function isAssessmentLogEnabled()
30 {
32 }
33
35 {
36 $this->assessmentLogEnabled = $assessmentLogEnabled;
37 }
38
40 {
41 return array(
42 array('name' => 'qpl_questions', 'type' => ilDB::LOCK_WRITE),
43 array('name' => 'tst_tests', 'type' => ilDB::LOCK_WRITE),
44 array('name' => 'tst_active', 'type' => ilDB::LOCK_WRITE),
45 array('name' => 'ass_log', 'type' => ilDB::LOCK_WRITE),
46 array('name' => 'ass_log', 'type' => ilDB::LOCK_WRITE, 'sequence' => true)
47 );
48 }
49
51 {
52 return array(
53 array('name' => 'tst_solutions', 'type' => ilDB::LOCK_WRITE),
54 array('name' => 'tst_solutions', 'type' => ilDB::LOCK_WRITE, 'sequence' => true)
55 );
56 }
57
59 {
60 return array(
61 array('name' => 'tst_test_result', 'type' => ilDB::LOCK_WRITE),
62 array('name' => 'tst_test_result', 'type' => ilDB::LOCK_WRITE, 'sequence' => true)
63 );
64 }
65
67 {
68 $tables = $this->getTablesUsedDuringSolutionUpdate();
69
70 if( $this->isAssessmentLogEnabled() )
71 {
72 $tables = array_merge($tables, $this->getTablesUsedDuringAssessmentLog());
73 }
74
75 $this->db->lockTables($tables);
76 }
77
79 {
80 $this->db->unlockTables();
81 }
82
84 {
85 $this->db->lockTables(array_merge(
87 ));
88 }
89
91 {
92 $this->db->unlockTables();
93 }
94
96 {
97 $this->db->lockTables(
99 );
100 }
101
103 {
104 $this->db->unlockTables();
105 }
106
108 {
109 // no lock neccessary, because a single replace query is used
110
111 //$this->db->lockTables(array(
112 // array('name' => 'tst_pass_result', 'type' => ilDB::LOCK_WRITE)
113 //));
114 }
115
117 {
118 // no lock neccessary, because a single replace query is used
119
120 //$this->db->unlockTables();
121 }
122
124 {
125 $this->db->lockTables(array(
126 array('name' => 'tst_result_cache', 'type' => ilDB::LOCK_WRITE)
127 ));
128 }
129
131 {
132 $this->db->unlockTables();
133 }
134}
Database Wrapper.
Definition: class.ilDB.php:29
const LOCK_WRITE
Definition: class.ilDB.php:30