61c421bf |
1 | puts "================" |
2 | puts "OCC1054" |
3 | puts "================" |
4 | puts "" |
5 | ####################################################################################### |
6 | # Mechanism of transactions' synchronization and mechanizm of nested transactions |
7 | ####################################################################################### |
8 | # Case 1 (nested mode ON) |
9 | ####################################################################################### |
10 | |
11 | proc OCC1054_Check_dump {IsGood index good_index case} { |
12 | # Check dump |
13 | if { ${index} != ${good_index} } { |
14 | set IsGood 0 |
15 | puts "OCC1054 Error (case ${case} : index = ${index} good_index = ${good_index})" |
16 | } |
17 | return ${IsGood} |
18 | } |
19 | |
20 | proc OCC1054_Check_real_attribute {IsGood doc label good_real case} { |
21 | global ${doc} |
22 | # Check real attribute |
23 | set percent_max 0.1 |
24 | if [catch { set real [GetReal ${doc} ${label}] } message] { |
25 | set IsGood 0 |
26 | puts "OCC1054 Error (case ${case})" |
27 | } else { |
28 | set real_percent [expr abs(${real} - ${good_real}) / double(${good_real}) * 100.] |
29 | if {${real_percent} > ${percent_max}} { |
30 | puts "good_real = ${good_real}" |
31 | puts "real = ${real}" |
32 | puts "real_percent = ${real_percent}" |
33 | puts "OCC1054 Error (case ${case}-2)" |
34 | } |
35 | } |
36 | return ${IsGood} |
37 | } |
38 | |
39 | |
40 | set IsGood 1 |
41 | set Case 0 |
42 | |
43 | NewDocument doc1 |
44 | NewDocument doc2 |
45 | NewDocument doc3 |
46 | mtmCreate 4 |
47 | |
48 | mtmNestedMode 1 |
49 | |
50 | mtmAdd doc1 |
51 | |
52 | mtmOpen |
53 | SetReal doc1 0:1:1 1.1 |
54 | OpenCommand doc1 |
55 | SetReal doc1 0:1:1 11 |
56 | AbortCommand doc1 |
57 | |
58 | OpenCommand doc1 |
59 | SetReal doc1 0:1:3 12.1 |
60 | |
61 | OpenCommand doc1 |
62 | SetReal doc1 0:1:3 121 |
63 | AbortCommand doc1 |
64 | |
65 | SetReal doc1 0:1:4 12.2 |
66 | CommitCommand doc1 |
67 | |
68 | SetReal doc1 0:1:1 1.2 |
69 | SetReal doc1 0:1:4 1.3 |
70 | mtmCommit Transaction1 |
71 | |
72 | set list [mtmDump] |
73 | ################################################################################ |
74 | # *** Dump of MTM *** |
75 | # There is one document ( "2690640" ) in the manager |
76 | # Nested transaction mode is on |
77 | # |
78 | # Undo: Transaction1 - 1 documents ( "2690640" ) < Last action |
79 | # |
80 | # *** End *** |
81 | ################################################################################ |
82 | set index1 [lsearch -exact ${list} "Transaction1"] |
83 | set docnum1 [lindex ${list} [expr ${index1} + 2]] |
84 | set index2 [lsearch -exact ${list} "Last"] |
85 | |
86 | # Check dump |
87 | set IsGood [OCC1054_Check_dump ${IsGood} ${index1} 21 [incr Case]] |
88 | set IsGood [OCC1054_Check_dump ${IsGood} ${docnum1} 1 [incr Case]] |
89 | set IsGood [OCC1054_Check_dump ${IsGood} ${index2} 29 [incr Case]] |
90 | |
91 | # Check real attributes |
92 | set IsGood [OCC1054_Check_real_attribute ${IsGood} ${doc1} 0:1:1 1.2 [incr Case]] |
93 | set IsGood [OCC1054_Check_real_attribute ${IsGood} ${doc1} 0:1:3 12.1 [incr Case]] |
94 | set IsGood [OCC1054_Check_real_attribute ${IsGood} ${doc1} 0:1:4 1.3 [incr Case]] |
95 | |
96 | mtmAdd doc2 |
97 | mtmAdd doc3 |
98 | |
99 | mtmOpen |
100 | SetReal doc2 0:2:1 2.1 |
101 | SetReal doc1 0:2:2 2.1 |
102 | OpenCommand doc1 |
103 | OpenCommand doc2 |
104 | SetReal doc2 0:2:1 21 |
105 | SetReal doc1 0:2:2 21 |
106 | AbortCommand doc2 |
107 | |
108 | OpenCommand doc3 |
109 | OpenCommand doc2 |
110 | SetReal doc3 0:2:3 22.1 |
111 | SetReal doc2 0:2:3 22.1 |
112 | |
113 | OpenCommand doc2 |
114 | SetReal doc2 0:2:3 221 |
115 | AbortCommand doc2 |
116 | |
117 | SetReal doc3 0:2:4 22.2 |
118 | CommitCommand doc2 |
119 | CommitCommand doc3 |
120 | AbortCommand doc1 |
121 | |
122 | SetReal doc1 0:2:1 2.2 |
123 | SetReal doc1 0:2:4 2.3 |
124 | mtmCommit Transaction2 |
125 | |
126 | set list [mtmDump] |
127 | ################################################################################ |
128 | # *** Dump of MTM *** |
129 | # There are 3 documents ( "2809192" "2705536" "2697976" ) in the manager |
130 | # Nested transaction mode is on |
131 | # |
132 | # Undo: Transaction1 - 1 documents ( "2809192" ) |
133 | # Undo: Transaction2 - 3 documents ( "2697976" "2705536" "2809192" ) < Last action |
134 | # |
135 | # *** End *** |
136 | ################################################################################ |
137 | |
138 | set index1 [lsearch -exact ${list} "Transaction1"] |
139 | set docnum1 [lindex ${list} [expr ${index1} + 2]] |
140 | set index2 [lsearch -exact ${list} "Transaction2"] |
141 | set docnum2 [lindex ${list} [expr ${index2} + 2]] |
142 | set index3 [lsearch -exact ${list} "Last"] |
143 | |
144 | # Check dump |
145 | set IsGood [OCC1054_Check_dump ${IsGood} ${index1} 23 [incr Case]] |
146 | set IsGood [OCC1054_Check_dump ${IsGood} ${docnum1} 1 [incr Case]] |
147 | set IsGood [OCC1054_Check_dump ${IsGood} ${index2} 31 [incr Case]] |
148 | set IsGood [OCC1054_Check_dump ${IsGood} ${docnum2} 3 [incr Case]] |
149 | set IsGood [OCC1054_Check_dump ${IsGood} ${index3} 41 [incr Case]] |
150 | |
151 | # Check real attributes |
152 | # doc1 |
153 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:1:1 1.2 [incr Case]] |
154 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:1:3 12.1 [incr Case]] |
155 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:1:4 1.3 [incr Case]] |
156 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:2:1 2.2 [incr Case]] |
157 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:2:2 2.1 [incr Case]] |
158 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:2:4 2.3 [incr Case]] |
159 | # doc2 |
160 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc2 0:2:1 2.1 [incr Case]] |
161 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc2 0:2:3 22.1 [incr Case]] |
162 | # doc3 |
163 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc3 0:2:3 22.1 [incr Case]] |
164 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc3 0:2:4 22.2 [incr Case]] |
165 | |
166 | mtmOpen |
167 | SetReal doc1 0:1:1 3.1 |
168 | OpenCommand doc1 |
169 | SetReal doc1 0:1:1 31 |
170 | AbortCommand doc1 |
171 | |
172 | OpenCommand doc1 |
173 | SetReal doc1 0:1:3 32.1 |
174 | |
175 | OpenCommand doc1 |
176 | SetReal doc1 0:1:3 321 |
177 | AbortCommand doc1 |
178 | |
179 | SetReal doc1 0:1:4 32.2 |
180 | CommitCommand doc1 |
181 | |
182 | SetReal doc1 0:1:1 3.2 |
183 | SetReal doc1 0:1:4 3.3 |
184 | mtmCommit Transaction3 |
185 | |
186 | set list [mtmDump] |
187 | ################################################################################ |
188 | # *** Dump of MTM *** |
189 | # There are 3 documents ( "2809192" "2705536" "2697976" ) in the manager |
190 | # Nested transaction mode is on |
191 | # |
192 | # Undo: Transaction1 - 1 documents ( "2809192" ) |
193 | # Undo: Transaction2 - 3 documents ( "2697976" "2705536" "2809192" ) |
194 | # Undo: Transaction3 - 1 documents ( "2809192" ) < Last action |
195 | # |
196 | # *** End *** |
197 | ################################################################################ |
198 | |
199 | set index1 [lsearch -exact ${list} "Transaction1"] |
200 | set docnum1 [lindex ${list} [expr ${index1} + 2]] |
201 | set index2 [lsearch -exact ${list} "Transaction2"] |
202 | set docnum2 [lindex ${list} [expr ${index2} + 2]] |
203 | set index3 [lsearch -exact ${list} "Transaction3"] |
204 | set docnum3 [lindex ${list} [expr ${index3} + 2]] |
205 | set index4 [lsearch -exact ${list} "Last"] |
206 | |
207 | # Check dump |
208 | set IsGood [OCC1054_Check_dump ${IsGood} ${index1} 23 [incr Case]] |
209 | set IsGood [OCC1054_Check_dump ${IsGood} ${docnum1} 1 [incr Case]] |
210 | set IsGood [OCC1054_Check_dump ${IsGood} ${index2} 31 [incr Case]] |
211 | set IsGood [OCC1054_Check_dump ${IsGood} ${docnum2} 3 [incr Case]] |
212 | set IsGood [OCC1054_Check_dump ${IsGood} ${index3} 41 [incr Case]] |
213 | set IsGood [OCC1054_Check_dump ${IsGood} ${docnum3} 1 [incr Case]] |
214 | set IsGood [OCC1054_Check_dump ${IsGood} ${index4} 49 [incr Case]] |
215 | |
216 | # Check real attributes |
217 | # doc1 |
218 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:1:1 3.2 [incr Case]] |
219 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:1:3 32.1 [incr Case]] |
220 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:1:4 3.3 [incr Case]] |
221 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:2:1 2.2 [incr Case]] |
222 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:2:2 2.1 [incr Case]] |
223 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:2:4 2.3 [incr Case]] |
224 | # doc2 |
225 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc2 0:2:1 2.1 [incr Case]] |
226 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc2 0:2:3 22.1 [incr Case]] |
227 | # doc3 |
228 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc3 0:2:3 22.1 [incr Case]] |
229 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc3 0:2:4 22.2 [incr Case]] |
230 | |
231 | mtmUndo |
232 | |
233 | set list [mtmDump] |
234 | ################################################################################ |
235 | # *** Dump of MTM *** |
236 | # There are 3 documents ( "2809192" "2705536" "2697976" ) in the manager |
237 | # Nested transaction mode is on |
238 | # |
239 | # Undo: Transaction1 - 1 documents ( "2809192" ) |
240 | # Undo: Transaction2 - 3 documents ( "2697976" "2705536" "2809192" ) < Last action |
241 | # Redo: Transaction3 - 1 documents ( "2809192" ) |
242 | # |
243 | # *** End *** |
244 | ################################################################################ |
245 | |
246 | set index1 [lsearch -exact ${list} "Transaction1"] |
247 | set docnum1 [lindex ${list} [expr ${index1} + 2]] |
248 | set index2 [lsearch -exact ${list} "Transaction2"] |
249 | set docnum2 [lindex ${list} [expr ${index2} + 2]] |
250 | set index3 [lsearch -exact ${list} "Transaction3"] |
251 | set docnum3 [lindex ${list} [expr ${index3} + 2]] |
252 | set redo3 [lindex ${list} [expr ${index3} - 1]] |
253 | set index4 [lsearch -exact ${list} "Last"] |
254 | |
255 | # Check dump |
256 | set IsGood [OCC1054_Check_dump ${IsGood} ${index1} 23 [incr Case]] |
257 | set IsGood [OCC1054_Check_dump ${IsGood} ${docnum1} 1 [incr Case]] |
258 | set IsGood [OCC1054_Check_dump ${IsGood} ${index2} 31 [incr Case]] |
259 | set IsGood [OCC1054_Check_dump ${IsGood} ${docnum2} 3 [incr Case]] |
260 | set IsGood [OCC1054_Check_dump ${IsGood} ${index3} 44 [incr Case]] |
261 | set IsGood [OCC1054_Check_dump ${IsGood} ${docnum3} 1 [incr Case]] |
262 | set IsGood [OCC1054_Check_dump ${IsGood} ${redo3} "Redo:" [incr Case]] |
263 | set IsGood [OCC1054_Check_dump ${IsGood} ${index4} 41 [incr Case]] |
264 | |
265 | # Check real attributes |
266 | # doc1 |
267 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:1:1 1.2 [incr Case]] |
268 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:1:3 12.1 [incr Case]] |
269 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:1:4 1.3 [incr Case]] |
270 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:2:1 2.2 [incr Case]] |
271 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:2:2 2.1 [incr Case]] |
272 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:2:4 2.3 [incr Case]] |
273 | # doc2 |
274 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc2 0:2:1 2.1 [incr Case]] |
275 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc2 0:2:3 22.1 [incr Case]] |
276 | # doc3 |
277 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc3 0:2:3 22.1 [incr Case]] |
278 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc3 0:2:4 22.2 [incr Case]] |
279 | |
280 | mtmOpen |
281 | SetReal doc1 0:1:1 4.1 |
282 | OpenCommand doc1 |
283 | SetReal doc1 0:1:1 41 |
284 | AbortCommand doc1 |
285 | |
286 | OpenCommand doc1 |
287 | SetReal doc1 0:1:3 42.1 |
288 | |
289 | OpenCommand doc1 |
290 | SetReal doc1 0:1:3 421 |
291 | mtmAbort |
292 | |
293 | set list [mtmDump] |
294 | ################################################################################ |
295 | # *** Dump of MTM *** |
296 | # There are 3 documents ( "2809192" "2705536" "2697976" ) in the manager |
297 | # Nested transaction mode is on |
298 | # |
299 | # Undo: Transaction1 - 1 documents ( "2809192" ) |
300 | # Undo: Transaction2 - 3 documents ( "2697976" "2705536" "2809192" ) < Last action |
301 | # Redo: Transaction3 - 1 documents ( "2809192" ) |
302 | # |
303 | # *** End *** |
304 | ################################################################################ |
305 | |
306 | set index1 [lsearch -exact ${list} "Transaction1"] |
307 | set docnum1 [lindex ${list} [expr ${index1} + 2]] |
308 | set index2 [lsearch -exact ${list} "Transaction2"] |
309 | set docnum2 [lindex ${list} [expr ${index2} + 2]] |
310 | set index3 [lsearch -exact ${list} "Transaction3"] |
311 | set docnum3 [lindex ${list} [expr ${index3} + 2]] |
312 | set redo3 [lindex ${list} [expr ${index3} - 1]] |
313 | set index4 [lsearch -exact ${list} "Last"] |
314 | |
315 | # Check dump |
316 | set IsGood [OCC1054_Check_dump ${IsGood} ${index1} 23 [incr Case]] |
317 | set IsGood [OCC1054_Check_dump ${IsGood} ${docnum1} 1 [incr Case]] |
318 | set IsGood [OCC1054_Check_dump ${IsGood} ${index2} 31 [incr Case]] |
319 | set IsGood [OCC1054_Check_dump ${IsGood} ${docnum2} 3 [incr Case]] |
320 | set IsGood [OCC1054_Check_dump ${IsGood} ${index3} 44 [incr Case]] |
321 | set IsGood [OCC1054_Check_dump ${IsGood} ${docnum3} 1 [incr Case]] |
322 | set IsGood [OCC1054_Check_dump ${IsGood} ${redo3} "Redo:" [incr Case]] |
323 | set IsGood [OCC1054_Check_dump ${IsGood} ${index4} 41 [incr Case]] |
324 | |
325 | # Check real attributes |
326 | # doc1 |
327 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:1:1 1.2 [incr Case]] |
328 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:1:3 12.1 [incr Case]] |
329 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:1:4 1.3 [incr Case]] |
330 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:2:1 2.2 [incr Case]] |
331 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:2:2 2.1 [incr Case]] |
332 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:2:4 2.3 [incr Case]] |
333 | # doc2 |
334 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc2 0:2:1 2.1 [incr Case]] |
335 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc2 0:2:3 22.1 [incr Case]] |
336 | # doc3 |
337 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc3 0:2:3 22.1 [incr Case]] |
338 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc3 0:2:4 22.2 [incr Case]] |
339 | |
340 | mtmRedo |
341 | |
342 | set list [mtmDump] |
343 | ################################################################################ |
344 | # *** Dump of MTM *** |
345 | # There are 3 documents ( "2809192" "2705536" "2697976" ) in the manager |
346 | # Nested transaction mode is on |
347 | # |
348 | # Undo: Transaction1 - 1 documents ( "2809192" ) |
349 | # Undo: Transaction2 - 3 documents ( "2697976" "2705536" "2809192" ) |
350 | # Undo: Transaction3 - 1 documents ( "2809192" ) < Last action |
351 | # |
352 | # *** End *** |
353 | ################################################################################ |
354 | |
355 | set index1 [lsearch -exact ${list} "Transaction1"] |
356 | set docnum1 [lindex ${list} [expr ${index1} + 2]] |
357 | set index2 [lsearch -exact ${list} "Transaction2"] |
358 | set docnum2 [lindex ${list} [expr ${index2} + 2]] |
359 | set index3 [lsearch -exact ${list} "Transaction3"] |
360 | set docnum3 [lindex ${list} [expr ${index3} + 2]] |
361 | set undo3 [lindex ${list} [expr ${index3} - 1]] |
362 | set index4 [lsearch -exact ${list} "Last"] |
363 | |
364 | # Check dump |
365 | set IsGood [OCC1054_Check_dump ${IsGood} ${index1} 23 [incr Case]] |
366 | set IsGood [OCC1054_Check_dump ${IsGood} ${docnum1} 1 [incr Case]] |
367 | set IsGood [OCC1054_Check_dump ${IsGood} ${index2} 31 [incr Case]] |
368 | set IsGood [OCC1054_Check_dump ${IsGood} ${docnum2} 3 [incr Case]] |
369 | set IsGood [OCC1054_Check_dump ${IsGood} ${index3} 41 [incr Case]] |
370 | set IsGood [OCC1054_Check_dump ${IsGood} ${docnum3} 1 [incr Case]] |
371 | set IsGood [OCC1054_Check_dump ${IsGood} ${undo3} "Undo:" [incr Case]] |
372 | set IsGood [OCC1054_Check_dump ${IsGood} ${index4} 49 [incr Case]] |
373 | |
374 | # Check real attributes |
375 | # doc1 |
376 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:1:1 3.2 [incr Case]] |
377 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:1:3 32.1 [incr Case]] |
378 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:1:4 3.3 [incr Case]] |
379 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:2:1 2.2 [incr Case]] |
380 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:2:2 2.1 [incr Case]] |
381 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:2:4 2.3 [incr Case]] |
382 | # doc2 |
383 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc2 0:2:1 2.1 [incr Case]] |
384 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc2 0:2:3 22.1 [incr Case]] |
385 | # doc3 |
386 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc3 0:2:3 22.1 [incr Case]] |
387 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc3 0:2:4 22.2 [incr Case]] |
388 | |
389 | mtmOpen |
390 | SetReal doc1 0:1:1 5.1 |
391 | OpenCommand doc1 |
392 | SetReal doc1 0:1:1 51 |
393 | |
394 | OpenCommand doc1 |
395 | SetReal doc1 0:1:3 52.1 |
396 | |
397 | OpenCommand doc1 |
398 | SetReal doc1 0:1:3 521 |
399 | mtmCommit Transaction5 |
400 | |
401 | set list [mtmDump] |
402 | ################################################################################ |
403 | # *** Dump of MTM *** |
404 | # There are 3 documents ( "2809192" "2705536" "2697976" ) in the manager |
405 | # Nested transaction mode is on |
406 | # |
407 | # Undo: Transaction1 - 1 documents ( "2809192" ) |
408 | # Undo: Transaction2 - 3 documents ( "2697976" "2705536" "2809192" ) |
409 | # Undo: Transaction3 - 1 documents ( "2809192" ) |
410 | # Undo: Transaction5 - 1 documents ( "2809192" ) < Last action |
411 | # |
412 | # *** End *** |
413 | ################################################################################ |
414 | |
415 | set index1 [lsearch -exact ${list} "Transaction1"] |
416 | set docnum1 [lindex ${list} [expr ${index1} + 2]] |
417 | set index2 [lsearch -exact ${list} "Transaction2"] |
418 | set docnum2 [lindex ${list} [expr ${index2} + 2]] |
419 | set index3 [lsearch -exact ${list} "Transaction3"] |
420 | set docnum3 [lindex ${list} [expr ${index3} + 2]] |
421 | set index4 [lsearch -exact ${list} "Transaction5"] |
422 | set docnum4 [lindex ${list} [expr ${index4} + 2]] |
423 | set index5 [lsearch -exact ${list} "Last"] |
424 | |
425 | # Check dump |
426 | set IsGood [OCC1054_Check_dump ${IsGood} ${index1} 23 [incr Case]] |
427 | set IsGood [OCC1054_Check_dump ${IsGood} ${docnum1} 1 [incr Case]] |
428 | set IsGood [OCC1054_Check_dump ${IsGood} ${index2} 31 [incr Case]] |
429 | set IsGood [OCC1054_Check_dump ${IsGood} ${docnum2} 3 [incr Case]] |
430 | set IsGood [OCC1054_Check_dump ${IsGood} ${index3} 41 [incr Case]] |
431 | set IsGood [OCC1054_Check_dump ${IsGood} ${docnum3} 1 [incr Case]] |
432 | set IsGood [OCC1054_Check_dump ${IsGood} ${index4} 49 [incr Case]] |
433 | set IsGood [OCC1054_Check_dump ${IsGood} ${docnum4} 1 [incr Case]] |
434 | set IsGood [OCC1054_Check_dump ${IsGood} ${index5} 57 [incr Case]] |
435 | |
436 | # Check real attributes |
437 | # doc1 |
438 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:1:1 51 [incr Case]] |
439 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:1:3 521 [incr Case]] |
440 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:1:4 3.3 [incr Case]] |
441 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:2:1 2.2 [incr Case]] |
442 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:2:2 2.1 [incr Case]] |
443 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:2:4 2.3 [incr Case]] |
444 | # doc2 |
445 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc2 0:2:1 2.1 [incr Case]] |
446 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc2 0:2:3 22.1 [incr Case]] |
447 | # doc3 |
448 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc3 0:2:3 22.1 [incr Case]] |
449 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc3 0:2:4 22.2 [incr Case]] |
450 | |
451 | mtmUndo |
452 | |
453 | set list [mtmDump] |
454 | ################################################################################ |
455 | # *** Dump of MTM *** |
456 | # There are 3 documents ( "2809192" "2705536" "3095112" ) in the manager |
457 | # Nested transaction mode is on |
458 | # |
459 | # Undo: Transaction1 - 1 documents ( "2809192" ) |
460 | # Undo: Transaction2 - 3 documents ( "3095112" "2705536" "2809192" ) |
461 | # Undo: Transaction3 - 1 documents ( "2809192" ) < Last action |
462 | # Redo: Transaction5 - 1 documents ( "2809192" ) |
463 | # |
464 | # *** End *** |
465 | ################################################################################ |
466 | |
467 | set index1 [lsearch -exact ${list} "Transaction1"] |
468 | set docnum1 [lindex ${list} [expr ${index1} + 2]] |
469 | set index2 [lsearch -exact ${list} "Transaction2"] |
470 | set docnum2 [lindex ${list} [expr ${index2} + 2]] |
471 | set index3 [lsearch -exact ${list} "Transaction3"] |
472 | set docnum3 [lindex ${list} [expr ${index3} + 2]] |
473 | set index4 [lsearch -exact ${list} "Transaction5"] |
474 | set docnum4 [lindex ${list} [expr ${index4} + 2]] |
475 | set redo4 [lindex ${list} [expr ${index4} - 1]] |
476 | set index5 [lsearch -exact ${list} "Last"] |
477 | |
478 | # Check dump |
479 | set IsGood [OCC1054_Check_dump ${IsGood} ${index1} 23 [incr Case]] |
480 | set IsGood [OCC1054_Check_dump ${IsGood} ${docnum1} 1 [incr Case]] |
481 | set IsGood [OCC1054_Check_dump ${IsGood} ${index2} 31 [incr Case]] |
482 | set IsGood [OCC1054_Check_dump ${IsGood} ${docnum2} 3 [incr Case]] |
483 | set IsGood [OCC1054_Check_dump ${IsGood} ${index3} 41 [incr Case]] |
484 | set IsGood [OCC1054_Check_dump ${IsGood} ${docnum3} 1 [incr Case]] |
485 | set IsGood [OCC1054_Check_dump ${IsGood} ${index4} 52 [incr Case]] |
486 | set IsGood [OCC1054_Check_dump ${IsGood} ${docnum4} 1 [incr Case]] |
487 | set IsGood [OCC1054_Check_dump ${IsGood} ${redo4} "Redo:" [incr Case]] |
488 | set IsGood [OCC1054_Check_dump ${IsGood} ${index5} 49 [incr Case]] |
489 | |
490 | # Check real attributes |
491 | # doc1 |
492 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:1:1 3.2 [incr Case]] |
493 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:1:3 32.1 [incr Case]] |
494 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:1:4 3.3 [incr Case]] |
495 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:2:1 2.2 [incr Case]] |
496 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:2:2 2.1 [incr Case]] |
497 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:2:4 2.3 [incr Case]] |
498 | # doc2 |
499 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc2 0:2:1 2.1 [incr Case]] |
500 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc2 0:2:3 22.1 [incr Case]] |
501 | # doc3 |
502 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc3 0:2:3 22.1 [incr Case]] |
503 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc3 0:2:4 22.2 [incr Case]] |
504 | |
505 | mtmOpen |
506 | SetReal doc1 0:1:1 6.1 |
507 | OpenCommand doc1 |
508 | SetReal doc1 0:1:1 61 |
509 | |
510 | OpenCommand doc1 |
511 | SetReal doc1 0:1:3 62.1 |
512 | |
513 | mtmCommit Transaction6 |
514 | |
515 | set list [mtmDump] |
516 | ################################################################################ |
517 | # *** Dump of MTM *** |
518 | # There are 3 documents ( "2809192" "2705536" "3095112" ) in the manager |
519 | # Nested transaction mode is on |
520 | # |
521 | # Undo: Transaction1 - 1 documents ( "2809192" ) |
522 | # Undo: Transaction2 - 3 documents ( "3095112" "2705536" "2809192" ) |
523 | # Undo: Transaction3 - 1 documents ( "2809192" ) |
524 | # Undo: Transaction6 - 1 documents ( "2809192" ) < Last action |
525 | # |
526 | # *** End *** |
527 | ################################################################################ |
528 | |
529 | set index1 [lsearch -exact ${list} "Transaction1"] |
530 | set docnum1 [lindex ${list} [expr ${index1} + 2]] |
531 | set index2 [lsearch -exact ${list} "Transaction2"] |
532 | set docnum2 [lindex ${list} [expr ${index2} + 2]] |
533 | set index3 [lsearch -exact ${list} "Transaction3"] |
534 | set docnum3 [lindex ${list} [expr ${index3} + 2]] |
535 | set index4 [lsearch -exact ${list} "Transaction6"] |
536 | set docnum4 [lindex ${list} [expr ${index4} + 2]] |
537 | set index5 [lsearch -exact ${list} "Last"] |
538 | |
539 | # Check dump |
540 | set IsGood [OCC1054_Check_dump ${IsGood} ${index1} 23 [incr Case]] |
541 | set IsGood [OCC1054_Check_dump ${IsGood} ${docnum1} 1 [incr Case]] |
542 | set IsGood [OCC1054_Check_dump ${IsGood} ${index2} 31 [incr Case]] |
543 | set IsGood [OCC1054_Check_dump ${IsGood} ${docnum2} 3 [incr Case]] |
544 | set IsGood [OCC1054_Check_dump ${IsGood} ${index3} 41 [incr Case]] |
545 | set IsGood [OCC1054_Check_dump ${IsGood} ${docnum3} 1 [incr Case]] |
546 | set IsGood [OCC1054_Check_dump ${IsGood} ${index4} 49 [incr Case]] |
547 | set IsGood [OCC1054_Check_dump ${IsGood} ${docnum4} 1 [incr Case]] |
548 | set IsGood [OCC1054_Check_dump ${IsGood} ${index5} 57 [incr Case]] |
549 | |
550 | # Check real attributes |
551 | # doc1 |
552 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:1:1 61 [incr Case]] |
553 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:1:3 62.1 [incr Case]] |
554 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:1:4 3.3 [incr Case]] |
555 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:2:1 2.2 [incr Case]] |
556 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:2:2 2.1 [incr Case]] |
557 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:2:4 2.3 [incr Case]] |
558 | # doc2 |
559 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc2 0:2:1 2.1 [incr Case]] |
560 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc2 0:2:3 22.1 [incr Case]] |
561 | # doc3 |
562 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc3 0:2:3 22.1 [incr Case]] |
563 | set IsGood [OCC1054_Check_real_attribute ${IsGood} doc3 0:2:4 22.2 [incr Case]] |
564 | |
565 | if { ${IsGood} == 1 } { |
566 | puts "OCC1054 OK" |
567 | } else { |
568 | puts "OCC1054 Error" |
569 | } |