1 |
| |
2 |
| |
3 |
| |
4 |
| |
5 |
| |
6 |
| |
7 |
| |
8 |
| |
9 |
| |
10 |
| |
11 |
| |
12 |
| |
13 |
| |
14 |
| |
15 |
| |
16 |
| |
17 |
| |
18 |
| |
19 |
| |
20 |
| |
21 |
| |
22 |
| |
23 |
| package org.jboss.cache.statetransfer; |
24 |
| |
25 |
| import org.jboss.cache.AbstractCacheListener; |
26 |
| import org.jboss.cache.CacheException; |
27 |
| import org.jboss.cache.CacheSPI; |
28 |
| import org.jboss.cache.Fqn; |
29 |
| import org.jboss.cache.Version; |
30 |
| import org.jboss.cache.misc.TestingUtil; |
31 |
| |
32 |
| import javax.transaction.Synchronization; |
33 |
| import javax.transaction.Transaction; |
34 |
| import javax.transaction.TransactionManager; |
35 |
| import java.util.Map; |
36 |
| |
37 |
| |
38 |
| |
39 |
| |
40 |
| |
41 |
| |
42 |
| |
43 |
| |
44 |
| |
45 |
| |
46 |
| public class ForcedStateTransferTest extends StateTransferTestBase |
47 |
| { |
48 |
| |
49 |
| |
50 |
| |
51 |
| |
52 |
| static class CacheStarter extends Thread |
53 |
| { |
54 |
| CacheSPI cache; |
55 |
| boolean useMarshalling; |
56 |
| Exception failure; |
57 |
| |
58 |
8
| CacheStarter(CacheSPI cache, boolean useMarshalling)
|
59 |
| { |
60 |
8
| this.cache = cache;
|
61 |
8
| this.useMarshalling = useMarshalling;
|
62 |
| } |
63 |
| |
64 |
8
| public void run()
|
65 |
| { |
66 |
8
| try
|
67 |
| { |
68 |
8
| cache.start();
|
69 |
| |
70 |
1
| if (useMarshalling)
|
71 |
| { |
72 |
| |
73 |
| |
74 |
| |
75 |
1
| TestingUtil.blockUntilViewReceived(cache, 2, 60000);
|
76 |
1
| cache.getRegion(Fqn.ROOT, true).activate();
|
77 |
| } |
78 |
| } |
79 |
| catch (Exception e) |
80 |
| { |
81 |
7
| failure = e;
|
82 |
| } |
83 |
| } |
84 |
| } |
85 |
| |
86 |
| |
87 |
| |
88 |
| |
89 |
| |
90 |
| static abstract class TaskRunner extends Thread |
91 |
| { |
92 |
| CacheSPI cache; |
93 |
| Fqn fqn; |
94 |
| String value; |
95 |
| Exception failure; |
96 |
| boolean asleep = false; |
97 |
| |
98 |
62
| TaskRunner(CacheSPI cache, String rootFqn, String value)
|
99 |
| { |
100 |
62
| this.cache = cache;
|
101 |
62
| this.value = value;
|
102 |
62
| this.fqn = new Fqn(Fqn.fromString(rootFqn), value);
|
103 |
| } |
104 |
| |
105 |
62
| public void run()
|
106 |
| { |
107 |
62
| try
|
108 |
| { |
109 |
| |
110 |
62
| executeTask();
|
111 |
| } |
112 |
| catch (Exception e) |
113 |
| { |
114 |
4
| if (!isDone())
|
115 |
1
| failure = e;
|
116 |
| } |
117 |
| finally |
118 |
| { |
119 |
25
| asleep = false;
|
120 |
| |
121 |
25
| finalCleanup();
|
122 |
| } |
123 |
| } |
124 |
| |
125 |
| abstract void executeTask() throws Exception; |
126 |
| |
127 |
| abstract boolean isDone(); |
128 |
| |
129 |
10
| void finalCleanup()
|
130 |
| { |
131 |
| } |
132 |
| |
133 |
665983
| boolean isAsleep()
|
134 |
| { |
135 |
665983
| return asleep;
|
136 |
| } |
137 |
| } |
138 |
| |
139 |
| |
140 |
| |
141 |
| |
142 |
| static class TxRunner extends TaskRunner |
143 |
| { |
144 |
| Transaction tx = null; |
145 |
| boolean rollback = false; |
146 |
| boolean done = true; |
147 |
| |
148 |
24
| TxRunner(CacheSPI cache, String rootFqn, String value, boolean rollback)
|
149 |
| { |
150 |
24
| super(cache, rootFqn, value);
|
151 |
24
| this.rollback = rollback;
|
152 |
| } |
153 |
| |
154 |
24
| void executeTask() throws Exception
|
155 |
| { |
156 |
24
| TransactionManager tm = cache.getTransactionManager();
|
157 |
24
| tm.begin();
|
158 |
24
| tx = tm.getTransaction();
|
159 |
| |
160 |
24
| cache.put(fqn, "KEY", value);
|
161 |
| |
162 |
24
| if (rollback)
|
163 |
12
| tx.setRollbackOnly();
|
164 |
| |
165 |
24
| asleep = true;
|
166 |
24
| TestingUtil.sleepThread((long) 25000);
|
167 |
15
| done = true;
|
168 |
| } |
169 |
| |
170 |
15
| void finalCleanup()
|
171 |
| { |
172 |
15
| if (tx != null)
|
173 |
| { |
174 |
15
| try { tx.commit(); } catch (Exception ignore) {}
|
175 |
| } |
176 |
| } |
177 |
| |
178 |
0
| boolean isDone()
|
179 |
| { |
180 |
0
| return done;
|
181 |
| } |
182 |
| } |
183 |
| |
184 |
| |
185 |
| |
186 |
| |
187 |
| static class HangThreadListener extends AbstractCacheListener |
188 |
| { |
189 |
| boolean asleep; |
190 |
| Fqn toHang; |
191 |
| boolean alreadyHung; |
192 |
| boolean done; |
193 |
| |
194 |
12
| HangThreadListener(Fqn toHang)
|
195 |
| { |
196 |
12
| this.toHang = toHang;
|
197 |
| } |
198 |
| |
199 |
48
| public void nodeModified(Fqn fqn, boolean pre, boolean isLocal, ModificationType modType, Map data)
|
200 |
| { |
201 |
24
| if (!pre) hangThread(fqn);
|
202 |
| } |
203 |
| |
204 |
24
| private void hangThread(Fqn fqn)
|
205 |
| { |
206 |
24
| if (!alreadyHung && toHang.equals(fqn))
|
207 |
| { |
208 |
12
| asleep = true;
|
209 |
| |
210 |
12
| alreadyHung = true;
|
211 |
12
| TestingUtil.sleepThread((long) 30000);
|
212 |
3
| done = true;
|
213 |
3
| asleep = false;
|
214 |
| } |
215 |
| } |
216 |
| } |
217 |
| |
218 |
| |
219 |
| |
220 |
| |
221 |
| static class HangThreadRunner extends TaskRunner |
222 |
| { |
223 |
| HangThreadListener listener; |
224 |
| |
225 |
12
| HangThreadRunner(CacheSPI cache, String rootFqn, String value)
|
226 |
| { |
227 |
12
| super(cache, rootFqn, value);
|
228 |
12
| listener = new HangThreadListener(fqn);
|
229 |
12
| cache.addCacheListener(listener);
|
230 |
| } |
231 |
| |
232 |
12
| void executeTask() throws Exception
|
233 |
| { |
234 |
| |
235 |
12
| cache.put(fqn, "KEY", value);
|
236 |
| } |
237 |
| |
238 |
268907
| boolean isAsleep()
|
239 |
| { |
240 |
268907
| return listener.asleep;
|
241 |
| } |
242 |
| |
243 |
3
| boolean isDone()
|
244 |
| { |
245 |
3
| return listener.done;
|
246 |
| } |
247 |
| } |
248 |
| |
249 |
| |
250 |
| |
251 |
| |
252 |
| |
253 |
| static class HangThreadSynchronization implements Synchronization |
254 |
| { |
255 |
| boolean asleep; |
256 |
| boolean hangBefore; |
257 |
| boolean done; |
258 |
| |
259 |
26
| HangThreadSynchronization(boolean hangBefore)
|
260 |
| { |
261 |
26
| this.hangBefore = hangBefore;
|
262 |
| } |
263 |
| |
264 |
25
| public void beforeCompletion()
|
265 |
| { |
266 |
25
| if (hangBefore)
|
267 |
| { |
268 |
12
| hang();
|
269 |
| } |
270 |
| } |
271 |
| |
272 |
16
| public void afterCompletion(int status)
|
273 |
| { |
274 |
16
| if (!hangBefore)
|
275 |
| { |
276 |
13
| hang();
|
277 |
| } |
278 |
| } |
279 |
| |
280 |
25
| void hang()
|
281 |
| { |
282 |
25
| asleep = true;
|
283 |
25
| TestingUtil.sleepThread((long) 30000);
|
284 |
6
| done = true;
|
285 |
| } |
286 |
| |
287 |
| } |
288 |
| |
289 |
| |
290 |
| |
291 |
| |
292 |
| |
293 |
| static class SynchronizationTxRunner extends TaskRunner |
294 |
| { |
295 |
| Transaction tx = null; |
296 |
| HangThreadSynchronization sync; |
297 |
| |
298 |
26
| SynchronizationTxRunner(CacheSPI cache, String rootFqn, String value, boolean hangBefore)
|
299 |
| { |
300 |
26
| super(cache, rootFqn, value);
|
301 |
26
| this.sync = new HangThreadSynchronization(hangBefore);
|
302 |
| } |
303 |
| |
304 |
26
| void executeTask() throws Exception
|
305 |
| { |
306 |
26
| TransactionManager tm = cache.getTransactionManager();
|
307 |
26
| tm.begin();
|
308 |
26
| tx = tm.getTransaction();
|
309 |
26
| tx.registerSynchronization(sync);
|
310 |
| |
311 |
26
| cache.put(fqn, "KEY", value);
|
312 |
| |
313 |
| |
314 |
25
| tx.commit();
|
315 |
| } |
316 |
| |
317 |
725687
| boolean isAsleep()
|
318 |
| { |
319 |
725687
| return sync.asleep;
|
320 |
| } |
321 |
| |
322 |
1
| boolean isDone()
|
323 |
| { |
324 |
1
| return sync.done;
|
325 |
| } |
326 |
| } |
327 |
| |
328 |
| |
329 |
| |
330 |
| |
331 |
| |
332 |
| |
333 |
| |
334 |
1
| public void testActiveTransaction() throws Exception
|
335 |
| { |
336 |
1
| String[] values = {"A", "B", "C"};
|
337 |
1
| transactionTest(values, false, "REPEATABLE_READ");
|
338 |
| } |
339 |
| |
340 |
| |
341 |
| |
342 |
| |
343 |
| |
344 |
| |
345 |
| |
346 |
1
| public void testRollbackOnlyTransaction() throws Exception
|
347 |
| { |
348 |
1
| String[] values = {"A", "B", "C"};
|
349 |
1
| transactionTest(values, true, "REPEATABLE_READ");
|
350 |
| } |
351 |
| |
352 |
| |
353 |
| |
354 |
| |
355 |
| |
356 |
| |
357 |
| |
358 |
| |
359 |
| |
360 |
| |
361 |
| |
362 |
2
| private void transactionTest(String[] values,
|
363 |
| boolean rollback, |
364 |
| String isolationLevel) throws Exception |
365 |
| { |
366 |
| |
367 |
2
| CacheSPI sender = initializeSender(isolationLevel, false, false);
|
368 |
| |
369 |
| |
370 |
2
| TxRunner[] runners =
|
371 |
| initializeTransactionRunners(values, sender, "/LOCK", rollback); |
372 |
| |
373 |
| |
374 |
2
| CacheSPI receiver = startReceiver(isolationLevel, false, false);
|
375 |
| |
376 |
| |
377 |
0
| checkResults(receiver, runners, false);
|
378 |
| } |
379 |
| |
380 |
| |
381 |
| |
382 |
| |
383 |
| |
384 |
| |
385 |
| |
386 |
| |
387 |
| |
388 |
| |
389 |
| |
390 |
| |
391 |
9
| private CacheSPI initializeSender(String isolationLevel,
|
392 |
| boolean replSync, |
393 |
| boolean useMarshalling) throws Exception |
394 |
| { |
395 |
9
| CacheSPI sender = createCache("sender", isolationLevel, replSync, useMarshalling, true);
|
396 |
| |
397 |
9
| if (useMarshalling)
|
398 |
1
| sender.getRegion(Fqn.ROOT, true).activate();
|
399 |
| |
400 |
9
| sender.put(Fqn.fromString("/OK"), "KEY", "X");
|
401 |
| |
402 |
9
| return sender;
|
403 |
| } |
404 |
| |
405 |
| |
406 |
| |
407 |
| |
408 |
| |
409 |
| |
410 |
| |
411 |
| |
412 |
| |
413 |
| |
414 |
| |
415 |
| |
416 |
| |
417 |
| |
418 |
8
| private TxRunner[] initializeTransactionRunners(String[] values,
|
419 |
| CacheSPI sender, |
420 |
| String rootFqn, |
421 |
| boolean rollback) |
422 |
| { |
423 |
8
| TxRunner[] runners = new TxRunner[values.length];
|
424 |
8
| for (int i = 0; i < values.length; i++)
|
425 |
| { |
426 |
24
| runners[i] = new TxRunner(sender, rootFqn, values[i], rollback);
|
427 |
24
| initializeRunner(runners[i]);
|
428 |
| } |
429 |
| |
430 |
8
| return runners;
|
431 |
| } |
432 |
| |
433 |
| |
434 |
| |
435 |
| |
436 |
| |
437 |
| |
438 |
| |
439 |
62
| private void initializeRunner(TaskRunner runner)
|
440 |
| { |
441 |
62
| runner.start();
|
442 |
| |
443 |
| |
444 |
62
| long start = System.currentTimeMillis();
|
445 |
62
| while (!(runner.isAsleep()))
|
446 |
| { |
447 |
1660516
| assertTrue(runner.getClass().getName() + " " + runner.value +
|
448 |
| " is alive", runner.isAlive()); |
449 |
| |
450 |
1660516
| assertFalse(runner.getClass().getName() + " " + runner.value +
|
451 |
| " has not timed out", |
452 |
| (System.currentTimeMillis() - start) > 1000); |
453 |
| } |
454 |
| } |
455 |
| |
456 |
| |
457 |
| |
458 |
| |
459 |
| |
460 |
| |
461 |
| |
462 |
| |
463 |
| |
464 |
| |
465 |
| |
466 |
1
| private void checkResults(CacheSPI receiver,
|
467 |
| TaskRunner[] runners, |
468 |
| boolean allowValues) throws CacheException |
469 |
| { |
470 |
| |
471 |
1
| boolean[] aliveStates = new boolean[runners.length];
|
472 |
1
| for (int i = 0; i < runners.length; i++)
|
473 |
| { |
474 |
3
| aliveStates[i] = runners[i].isAlive();
|
475 |
3
| if (aliveStates[i])
|
476 |
3
| runners[i].interrupt();
|
477 |
| } |
478 |
| |
479 |
| |
480 |
1
| assertEquals("OK value correct", "X", receiver.get(Fqn.fromString("/OK"), "KEY"));
|
481 |
| |
482 |
0
| for (int i = 0; i < runners.length; i++)
|
483 |
| { |
484 |
0
| assertTrue("Runner " + runners[i].value + " was alive", aliveStates[i]);
|
485 |
0
| assertNull("Runner " + runners[i].value + " ran cleanly", runners[i].failure);
|
486 |
0
| if (allowValues)
|
487 |
| { |
488 |
0
| assertEquals("Correct value in " + runners[i].fqn,
|
489 |
| runners[i].value, receiver.get(runners[i].fqn, "KEY")); |
490 |
| } |
491 |
| else |
492 |
| { |
493 |
0
| assertNull("No value in " + runners[i].fqn,
|
494 |
| receiver.get(runners[i].fqn, "KEY")); |
495 |
| } |
496 |
| } |
497 |
| } |
498 |
| |
499 |
| |
500 |
| |
501 |
| |
502 |
| |
503 |
| |
504 |
| |
505 |
1
| public void testHungThread() throws Exception
|
506 |
| { |
507 |
| |
508 |
1
| CacheSPI sender = initializeSender("REPEATABLE_READ", false, false);
|
509 |
| |
510 |
| |
511 |
1
| String[] values = {"A", "B", "C"};
|
512 |
1
| HangThreadRunner[] runners = initializeHangThreadRunners(values, sender, "/LOCK");
|
513 |
| |
514 |
| |
515 |
1
| CacheSPI receiver = startReceiver("REPEATABLE_READ", false, false);
|
516 |
| |
517 |
| |
518 |
0
| checkResults(receiver, runners, true);
|
519 |
| } |
520 |
| |
521 |
| |
522 |
| |
523 |
| |
524 |
| |
525 |
| |
526 |
| |
527 |
| |
528 |
| |
529 |
| |
530 |
| |
531 |
| |
532 |
| |
533 |
4
| private HangThreadRunner[] initializeHangThreadRunners(String[] values,
|
534 |
| CacheSPI sender, |
535 |
| String rootFqn) |
536 |
| { |
537 |
4
| HangThreadRunner[] runners = new HangThreadRunner[values.length];
|
538 |
4
| for (int i = 0; i < values.length; i++)
|
539 |
| { |
540 |
12
| runners[i] = new HangThreadRunner(sender, rootFqn, values[i]);
|
541 |
12
| initializeRunner(runners[i]);
|
542 |
| } |
543 |
| |
544 |
4
| return runners;
|
545 |
| } |
546 |
| |
547 |
| |
548 |
| |
549 |
| |
550 |
| |
551 |
| |
552 |
| |
553 |
| |
554 |
1
| public void testBeforeCompletionLock() throws Exception
|
555 |
| { |
556 |
1
| synchronizationTest(true);
|
557 |
| } |
558 |
| |
559 |
| |
560 |
| |
561 |
| |
562 |
| |
563 |
| |
564 |
| |
565 |
| |
566 |
1
| public void testAfterCompletionLock() throws Exception
|
567 |
| { |
568 |
1
| synchronizationTest(false);
|
569 |
| } |
570 |
| |
571 |
| |
572 |
| |
573 |
| |
574 |
| |
575 |
| |
576 |
| |
577 |
| |
578 |
| |
579 |
| |
580 |
| |
581 |
| |
582 |
2
| private void synchronizationTest(boolean hangBefore) throws Exception
|
583 |
| { |
584 |
2
| CacheSPI sender = initializeSender("REPEATABLE_READ", false, false);
|
585 |
| |
586 |
2
| String[] values = {"A", "B", "C"};
|
587 |
2
| SynchronizationTxRunner[] runners =
|
588 |
| initializeSynchronizationTxRunners(values, sender, "/LOCK", hangBefore); |
589 |
| |
590 |
2
| CacheSPI receiver = startReceiver("REPEATABLE_READ", false, false);
|
591 |
| |
592 |
0
| checkResults(receiver, runners, !hangBefore);
|
593 |
| } |
594 |
| |
595 |
| |
596 |
| |
597 |
| |
598 |
| |
599 |
| |
600 |
| |
601 |
| |
602 |
| |
603 |
| |
604 |
| |
605 |
| |
606 |
| |
607 |
| |
608 |
| |
609 |
| |
610 |
| |
611 |
9
| private SynchronizationTxRunner[] initializeSynchronizationTxRunners(String[] values,
|
612 |
| CacheSPI sender, |
613 |
| String rootFqn, |
614 |
| boolean hangBefore) |
615 |
| { |
616 |
9
| SynchronizationTxRunner[] runners =
|
617 |
| new SynchronizationTxRunner[values.length]; |
618 |
9
| for (int i = 0; i < values.length; i++)
|
619 |
| { |
620 |
26
| runners[i] = new SynchronizationTxRunner(sender, rootFqn, values[i], hangBefore);
|
621 |
26
| initializeRunner(runners[i]);
|
622 |
| } |
623 |
8
| return runners;
|
624 |
| } |
625 |
| |
626 |
| |
627 |
| |
628 |
| |
629 |
| |
630 |
| |
631 |
| |
632 |
| |
633 |
| |
634 |
1
| public void testMultipleProblems() throws Exception
|
635 |
| { |
636 |
1
| multipleProblemTest("REPEATABLE_READ", "/LOCK", false, false);
|
637 |
| } |
638 |
| |
639 |
| |
640 |
| |
641 |
| |
642 |
| |
643 |
| |
644 |
| |
645 |
| |
646 |
1
| public void testSerializableIsolation() throws Exception
|
647 |
| { |
648 |
1
| multipleProblemTest("SERIALIZABLE", "/", false, false);
|
649 |
| } |
650 |
| |
651 |
| |
652 |
| |
653 |
| |
654 |
| |
655 |
| |
656 |
| |
657 |
| |
658 |
| |
659 |
1
| public void testPartialStateTransfer() throws Exception
|
660 |
| { |
661 |
1
| multipleProblemTest("REPEATABLE_READ", "/LOCK", false, true);
|
662 |
| } |
663 |
| |
664 |
| |
665 |
| |
666 |
| |
667 |
| |
668 |
| |
669 |
| |
670 |
| |
671 |
| |
672 |
1
| public void testReplSync() throws Exception
|
673 |
| { |
674 |
1
| multipleProblemTest("REPEATABLE_READ", "/LOCK", true, false);
|
675 |
| } |
676 |
| |
677 |
| |
678 |
| |
679 |
| |
680 |
| |
681 |
| |
682 |
| |
683 |
4
| private void multipleProblemTest(String isolationLevel,
|
684 |
| String rootFqn, |
685 |
| boolean replSync, |
686 |
| boolean useMarshalling) throws Exception |
687 |
| { |
688 |
4
| CacheSPI sender = initializeSender(isolationLevel, replSync, useMarshalling);
|
689 |
| |
690 |
| |
691 |
| |
692 |
| |
693 |
| |
694 |
| |
695 |
4
| String[] val1 = {"A", "B", "C"};
|
696 |
4
| SynchronizationTxRunner[] after =
|
697 |
| initializeSynchronizationTxRunners(val1, sender, rootFqn, false); |
698 |
| |
699 |
3
| String[] val2 = {"D", "E", "F"};
|
700 |
3
| SynchronizationTxRunner[] before =
|
701 |
| initializeSynchronizationTxRunners(val2, sender, rootFqn, true); |
702 |
| |
703 |
3
| String[] val3 = {"G", "H", "I"};
|
704 |
3
| TxRunner[] active =
|
705 |
| initializeTransactionRunners(val3, sender, rootFqn, false); |
706 |
| |
707 |
3
| String[] val4 = {"J", "K", "L"};
|
708 |
3
| TxRunner[] rollback =
|
709 |
| initializeTransactionRunners(val4, sender, rootFqn, true); |
710 |
| |
711 |
3
| String[] val5 = {"M", "N", "O"};
|
712 |
3
| HangThreadRunner[] threads =
|
713 |
| initializeHangThreadRunners(val5, sender, rootFqn); |
714 |
| |
715 |
3
| CacheSPI receiver = startReceiver(isolationLevel, replSync, useMarshalling);
|
716 |
| |
717 |
1
| checkResults(receiver, active, false);
|
718 |
0
| checkResults(receiver, rollback, false);
|
719 |
0
| checkResults(receiver, before, false);
|
720 |
0
| checkResults(receiver, after, true);
|
721 |
0
| checkResults(receiver, threads, true);
|
722 |
| } |
723 |
| |
724 |
17
| protected String getReplicationVersion()
|
725 |
| { |
726 |
17
| return Version.version;
|
727 |
| } |
728 |
| |
729 |
| |
730 |
| |
731 |
| |
732 |
| |
733 |
| |
734 |
| |
735 |
| |
736 |
| |
737 |
| |
738 |
| |
739 |
8
| private CacheSPI startReceiver(String isolationLevel,
|
740 |
| boolean replSync, |
741 |
| boolean useMarshalling) throws Exception |
742 |
| { |
743 |
8
| CacheSPI receiver = createCache("receiver", isolationLevel, replSync, useMarshalling, false);
|
744 |
| |
745 |
| |
746 |
| |
747 |
8
| CacheStarter starter = new CacheStarter(receiver, useMarshalling);
|
748 |
| |
749 |
8
| starter.start();
|
750 |
| |
751 |
8
| starter.join(20000);
|
752 |
| |
753 |
8
| boolean alive = starter.isAlive();
|
754 |
8
| if (alive)
|
755 |
0
| starter.interrupt();
|
756 |
8
| assertFalse("Starter finished", alive);
|
757 |
| |
758 |
8
| assertNull("No exceptions in starter", starter.failure);
|
759 |
| |
760 |
1
| return receiver;
|
761 |
| } |
762 |
| |
763 |
| |
764 |
| |
765 |
| |
766 |
| |
767 |
17
| private CacheSPI createCache(String cacheID,
|
768 |
| String isolationLevel, |
769 |
| boolean replSync, |
770 |
| boolean useMarshalling, |
771 |
| boolean startCache) |
772 |
| throws Exception |
773 |
| { |
774 |
17
| CacheSPI result = super.createCache(cacheID, replSync,
|
775 |
| useMarshalling, false, false, false); |
776 |
17
| result.getConfiguration().setInitialStateRetrievalTimeout(0);
|
777 |
17
| result.getConfiguration().setLockAcquisitionTimeout(1000);
|
778 |
17
| result.getConfiguration().setIsolationLevel(isolationLevel);
|
779 |
| |
780 |
17
| if (startCache)
|
781 |
9
| result.start();
|
782 |
| |
783 |
17
| return result;
|
784 |
| } |
785 |
| |
786 |
| |
787 |
| } |