openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From curti...@apache.org
Subject svn commit: r954898 - in /openjpa/trunk: openjpa-kernel/src/main/java/org/apache/openjpa/datacache/ openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/ openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kern...
Date Tue, 15 Jun 2010 14:10:46 GMT
Author: curtisr7
Date: Tue Jun 15 14:10:46 2010
New Revision: 954898

URL: http://svn.apache.org/viewvc?rev=954898&view=rev
Log:
OPENJPA-1692: Revert some of previous commit.

Modified:
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/DataCacheManagerImpl.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/TestPessimisticLocking.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/RuntimeTest1.java

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/DataCacheManagerImpl.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/DataCacheManagerImpl.java?rev=954898&r1=954897&r2=954898&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/DataCacheManagerImpl.java
(original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/DataCacheManagerImpl.java
Tue Jun 15 14:10:46 2010
@@ -57,17 +57,14 @@ public class DataCacheManagerImpl
     
     public void initialize(OpenJPAConfiguration conf, ObjectValue dataCache, ObjectValue
queryCache) {
         _conf = conf;
-        try {
-            _queryCache = (QueryCache) queryCache.instantiate(QueryCache.class, conf);
-            if (_queryCache != null)
-                _queryCache.initialize(this);
-            _cache = (DataCache) dataCache.instantiate(DataCache.class, conf);
-
-            if (_cache == null)
-                return;
-        } catch (Exception cnfe) {
-            System.err.println("Caught a cnfe upon creation of the " + DataCacheManagerImpl.class.getName());
-        }
+        _queryCache = (QueryCache) queryCache.instantiate(QueryCache.class, conf);
+        if (_queryCache != null)
+            _queryCache.initialize(this);
+        _cache = (DataCache) dataCache.instantiate(DataCache.class, conf);
+
+        if (_cache == null)
+            return;
+         
         // create helpers before initializing caches
         if (conf.getDynamicDataStructs())
             _pcGenerator = new DataCachePCDataGenerator(conf);

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/TestPessimisticLocking.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/TestPessimisticLocking.java?rev=954898&r1=954897&r2=954898&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/TestPessimisticLocking.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/TestPessimisticLocking.java
Tue Jun 15 14:10:46 2010
@@ -39,9 +39,6 @@ import org.apache.openjpa.persistence.co
 
 import org.apache.openjpa.jdbc.conf.JDBCConfiguration;
 import java.util.concurrent.locks.ReentrantLock;
-
-import javax.persistence.LockModeType;
-
 import org.apache.openjpa.persistence.OpenJPAEntityManager;
 import org.apache.openjpa.persistence.OpenJPAEntityManagerFactory;
 import org.apache.openjpa.persistence.jdbc.FetchMode;
@@ -89,10 +86,8 @@ public class TestPessimisticLocking exte
     public void setUp() throws Exception {
         super.setUp(RuntimeTest1.class, RuntimeTest2.class, RuntimeTest3.class);
 
-        Map<String,String> propsMap = new HashMap<String,String>();
-//        propsMap.put("openjpa.LockManager", "pessimistic");//<property name="openjpa.jdbc.TransactionIsolation"
value="read-committed" />
-        propsMap.put("openjpa.jdbc.TransactionIsolation", "read-committed");
-//        propsMap.put("openjpa.Log", "DefaultLevel=trace");
+        Map propsMap = new HashMap();
+        propsMap.put("openjpa.LockManager", "pessimistic");
         _factory = getEmf(propsMap);
 
         OpenJPAEntityManager pm = getLockingPM();
@@ -114,15 +109,10 @@ public class TestPessimisticLocking exte
         }
     }
 
-    public void test() throws Exception {
-        OpenJPAEntityManager em = getLockingPM();
-//        em.createQuery("select c from RuntimeTest1 c where 1=1").getResultList();
-        em.createNamedQuery("asdf").getResultList();
-    }
     /**
      * Test that pessimistic locking is working in the data store.
      */
-    public void atestPessimisticLocking() throws Throwable {
+    public void testPessimisticLocking() throws Throwable {
         pessimisticLockingTest(false);
     }
 
@@ -131,7 +121,7 @@ public class TestPessimisticLocking exte
      * test will validate that the test case itself is working correctly, not
      * that the datastore's pessimistic locking is working.
      */
-    public void atestPessimisticLockingInternal() throws Throwable {
+    public void testPessimisticLockingInternal() throws Throwable {
         pessimisticLockingTest(true);
     }
 
@@ -284,4 +274,3 @@ public class TestPessimisticLocking exte
 	}
 
 }
-

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/RuntimeTest1.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/RuntimeTest1.java?rev=954898&r1=954897&r2=954898&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/RuntimeTest1.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/RuntimeTest1.java
Tue Jun 15 14:10:46 2010
@@ -30,8 +30,6 @@ import javax.persistence.FetchType;
 import javax.persistence.Id;
 import javax.persistence.Inheritance;
 import javax.persistence.InheritanceType;
-import javax.persistence.LockModeType;
-import javax.persistence.NamedQuery;
 import javax.persistence.OneToMany;
 import javax.persistence.OneToOne;
 import javax.persistence.Table;
@@ -46,7 +44,6 @@ import javax.persistence.Version;
  * @author Abe White
  */
 @Entity
-@NamedQuery(name="asdf",query="select c from RuntimeTest1 c where 1=1")
 @Table(name = "rtest1")
 @Inheritance(strategy = InheritanceType.SINGLE_TABLE)
 public class RuntimeTest1 implements Serializable {



Mime
View raw message