[exo-jcr-commits] exo-jcr SVN: r1505 - jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/cluster/prepare.

do-not-reply at jboss.org do-not-reply at jboss.org
Wed Jan 20 08:30:57 EST 2010


Author: nzamosenchuk
Date: 2010-01-20 08:30:57 -0500 (Wed, 20 Jan 2010)
New Revision: 1505

Modified:
   jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/cluster/prepare/TestLoadIndexerWriterWithModes.java
Log:
EXOJCR-396: added session.refresh(false) if exception occurs on session.save().

Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/cluster/prepare/TestLoadIndexerWriterWithModes.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/cluster/prepare/TestLoadIndexerWriterWithModes.java	2010-01-20 12:46:45 UTC (rev 1504)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/cluster/prepare/TestLoadIndexerWriterWithModes.java	2010-01-20 13:30:57 UTC (rev 1505)
@@ -46,7 +46,7 @@
    public static final String STATISTIC = "Statistic";
 
    private volatile boolean stop = false;
-   
+
    private AtomicBoolean makeThemWait = new AtomicBoolean();
 
    private int threadCount = 10;
@@ -56,9 +56,9 @@
    private final CountDownLatch doneSignal = new CountDownLatch(threadCount);
 
    private final CyclicBarrier barrier = new CyclicBarrier(threadCount);
-   
+
    private volatile CountDownLatch goSignal;
-   
+
    private static final String[] words =
       new String[]{"private", "branch", "final", "string", "logging", "bottle", "property", "node", "repository",
          "exception", "cycle", "value", "index", "meaning", "strange", "words", "hello", "outline", "finest",
@@ -95,7 +95,7 @@
             else
             {
                goSignal = new CountDownLatch(1);
-               makeThemWait.set(true);               
+               makeThemWait.set(true);
             }
          }
 
@@ -163,7 +163,9 @@
                }
                catch (Exception e1)
                {
-                 log.error("An error occurs", e1);
+                  // discard session changes 
+                  sessionLocal.refresh(false);
+                  log.error("An error occurs", e1);
                }
 
                try
@@ -175,7 +177,7 @@
                      goSignal.await();
                   }
                   else
-                  {                     
+                  {
                      Thread.sleep(300);
                   }
                }



More information about the exo-jcr-commits mailing list