forked from EILD-nrw/serialization_trainer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configs.js
193 lines (186 loc) · 4.94 KB
/
configs.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
/**
* @overview App configuration of <i>ccmjs</i>-based web component for Anomaly Trainer.
* @author André Kless <[email protected]> 2022
* @license The MIT License (MIT)
*/
/**
* Used app configuration of <i>ccmjs</i>-based web component for Anomaly Trainer.
* @module AppConfig
*/
/**
* Configuration to show Lost Update phenomena.
* @type {app_config}
*/
export const lost_update_gen = {
"title": "",
"task": "Beim \"Lost Update\"-Phänomen wird ein Wert, der von einer Transaktion geschrieben wurde von einer anderen Transaktion überschrieben.",
"ops": {
"read1": "read(A,a)",
"add_x": "a = a + x",
"write": "write(A,a)"
},
"topology": [
[
// Default Rules
[ "T1,read1", "T1,add_x" ],
[ "T1,add_x", "T1,write" ],
[ "T2,read1", "T2,add_x" ],
[ "T2,add_x", "T2,write" ],
// Dirty Read Rules
[ "T1,read1", "T2,write" ],
[ "T2,write", "T1,write" ]
]
]
};
/**
* Configuration to show Non-Repeatable Read phenomena.
* @type {app_config}
*/
export const non_repeatable_read_gen = {
"title": "",
"task": "Beim \"Non-Repeatable Read\"-Phänomen kann eine Transaktion während ihrer Laufzeit von einem Attribut zu unterschiedlichen Zeitpunkten unterschiedliche Werte lesen, da das Attribut während der Transaktion von einer anderen Transaktion verändert wurde.",
"ops": {
"read1": "read(A,a)",
"add_x": "a = a + x",
"write": "write(A,a)",
"read2": "read(A,a)"
},
"random": {},
"topology": [
[
// Default Rules
[ "T1,read1", "T1,add_x" ],
[ "T1,read2", "T1,write" ],
[ "T2,read1", "T2,add_x" ],
[ "T2,add_x", "T2,write" ],
[ "T1,read1", "T1,read2" ],
// Non-Repeatable-Read Rules
[ "T1,read1", "T2,write" ],
[ "T2,write", "T1,read2" ]
]
]
};
/**
* Configuration to show Dirty Read phenomena.
* @type {app_config}
*/
export const dirty_read_gen = {
"title": "",
"task": "Beim \"Dirty Read\"-Phänomen verändert eine Transaktion einen Wert, welcher von einer anderen Transaktion gelesen wird. Die Transaktion, die das Attribut verändert hat, wird allerdings zurückgesetzt und die andere Transaktion, die den veränderten Wert des Attributs gelesen hat, arbeitet auf einen \"verschmutzten\" Wert.",
"ops": {
"read1": "read(A,a)",
"add_x": "a = a + x",
"write": "write(A,a)",
"rollb": "rollback"
},
"random": {},
"topology": [
[
// Default Rules
[ "T1,read1", "T1,add_x" ],
[ "T1,add_x", "T1,write" ],
[ "T2,read1", "T2,add_x" ],
[ "T2,add_x", "T2,write" ],
[ "T1,read1", "T1,rollb" ],
// Dirty Read Rules
[ "T1,write", "T2,read1" ],
[ "T2,read1", "T1,rollb" ]
]
]
};
/**
* Configuration to train Lost Update phenomena.
* @type {app_config}
*/
export const lost_update_trainer = {
"title": "",
"task": "Prüfen Sie, ob während der folgenden beiden Datenbank-Transaktionen ein \"Lost Update\" aufgetreten ist.",
"ops": {
"read1": "read(A,a)",
"add_x": "a = a + x",
"write": "write(A,a)"
},
"topology": [
[
// Default Rules
[ "T1,read1", "T1,add_x" ],
[ "T1,add_x", "T1,write" ],
[ "T2,read1", "T2,add_x" ],
[ "T2,add_x", "T2,write" ],
],
{
// 'Lost Update' Rules
"label": "Lost Update",
"rules": [
[ "T1,read1", "T2,write" ],
[ "T2,write", "T1,write" ]
]
}
]
};
/**
* Configuration to train Non-Repeatable-Read phenomena.
* @type {app_config}
*/
export const non_repeatable_read_trainer = {
"title": "",
"task": "Prüfen Sie, ob während der folgenden beiden Datenbank-Transaktionen ein \"Non-Repeatable Read\" aufgetreten ist.",
"ops": {
"read1": "read(A,a)",
"add_x": "a = a + x",
"write": "write(A,a)",
"read2": "read(A,a)"
},
"random": {},
"topology": [
[
// Default Rules
[ "T1,read1", "T1,add_x" ],
[ "T1,add_x", "T1,write" ],
[ "T2,read1", "T2,add_x" ],
[ "T2,add_x", "T2,write" ],
[ "T1,read1", "T1,read2" ]
],
{
// 'Non-Repeatable Read' Rules
"label": "Non-Repeatable Read",
"rules": [
[ "T1,read1", "T2,write" ],
[ "T2,write", "T1,read2" ]
]
}
]
};
/**
* Configuration to train Dirty Read phenomena.
* @type {app_config}
*/
export const dirty_read_trainer = {
"title": "",
"task": "Prüfen Sie, ob während der folgenden beiden Datenbank-Transaktionen ein \"Dirty Read\" aufgetreten ist.",
"ops": {
"read1": "read(A,a)",
"add_x": "a = a + x",
"write": "write(A,a)",
"rollb": "rollback"
},
"random": {},
"topology": [
[
// Default Rules
[ "T1,read1", "T1,add_x" ],
[ "T1,add_x", "T1,write" ],
[ "T2,read1", "T2,add_x" ],
[ "T2,add_x", "T2,write" ],
[ "T1,read1", "T1,rollb" ]
],
{
// 'Dirty Read' Rules
"label": "Dirty Read",
"rules": [
[ "T1,write", "T2,read1" ],
[ "T2,read1", "T1,rollb" ]
]
}
]
};