openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mik...@apache.org
Subject svn commit: r792226 - in /openjpa/trunk: openjpa-kernel/src/main/java/org/apache/openjpa/writebehind/SimpleWriteBehindCallback.java openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/AbstractWriteBehindTestCase.java
Date Wed, 08 Jul 2009 16:47:34 GMT
Author: mikedd
Date: Wed Jul  8 16:47:34 2009
New Revision: 792226

URL: http://svn.apache.org/viewvc?rev=792226&view=rev
Log:
OPENJPA-1164. Making sleepTime configurable for SimpleWriteBehindCallback.

Modified:
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/writebehind/SimpleWriteBehindCallback.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/AbstractWriteBehindTestCase.java

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/writebehind/SimpleWriteBehindCallback.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/writebehind/SimpleWriteBehindCallback.java?rev=792226&r1=792225&r2=792226&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/writebehind/SimpleWriteBehindCallback.java
(original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/writebehind/SimpleWriteBehindCallback.java
Wed Jul  8 16:47:34 2009
@@ -53,7 +53,8 @@
             storeManager.begin();
             errors = storeManager.flush(sms);
             if(errors != null && !errors.isEmpty() ) {
-                for(Exception e : errors) { 
+                for(Exception e : errors) {
+                    // TODO add error handling.
                     e.printStackTrace();
                 }
             }
@@ -69,8 +70,7 @@
                 Thread.sleep(_sleepTime);
                 handleExceptions(flush());
             } catch (InterruptedException e) {
-                // TODO Auto-generated catch block
-                e.printStackTrace();
+                // ignore
             }
         }
     }
@@ -79,7 +79,6 @@
         if (exceptions != null && !exceptions.isEmpty()) {
             done = true;
             for (Exception e : exceptions) {
-                System.out.println(e.getMessage());
                 e.printStackTrace();
             }
         }
@@ -90,4 +89,12 @@
         flush();
         _broker.close();
     }
+    
+    public int getSleepTime() { 
+        return _sleepTime;
+    }
+    
+    public void setSleepTime(int sleepTime) { 
+        _sleepTime = sleepTime;
+    }
 }

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/AbstractWriteBehindTestCase.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/AbstractWriteBehindTestCase.java?rev=792226&r1=792225&r2=792226&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/AbstractWriteBehindTestCase.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/AbstractWriteBehindTestCase.java
Wed Jul  8 16:47:34 2009
@@ -36,7 +36,7 @@
             "openjpa.DataCache", "true",
             "openjpa.RemoteCommitProvider", "sjvm", 
             "openjpa.WriteBehindCache", "true",
-            "openjpa.WriteBehindCallback", "true", 
+            "openjpa.WriteBehindCallback", "true(sleepTime=15000)", 
             "openjpa.RuntimeUnenhancedClasses", "unsupported",
             SimpleNonGeneratedIdEntity.class, SimpleTableGeneratedIdEntity.class,
             AbstractSimpleEntity.class};
@@ -107,8 +107,7 @@
     }
     
     public void tearDown() throws Exception { 
-//        _validatorEMF.close();
-//        super.tearDown();
+        // intentionall skip super.tearDown()
     }
 
 }



Mime
View raw message