openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From curti...@apache.org
Subject svn commit: r934103 - /openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/MetaDataRepository.java
Date Wed, 14 Apr 2010 18:39:55 GMT
Author: curtisr7
Date: Wed Apr 14 18:39:54 2010
New Revision: 934103

URL: http://svn.apache.org/viewvc?rev=934103&view=rev
Log:
OPENJPA-1630: Synchronize when modifying MetaDataRepository._registered regardless of MetaDataRepository.Preload
setting.

Modified:
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/MetaDataRepository.java

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/MetaDataRepository.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/MetaDataRepository.java?rev=934103&r1=934102&r2=934103&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/MetaDataRepository.java
(original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/MetaDataRepository.java
Wed Apr 14 18:39:54 2010
@@ -1567,12 +1567,7 @@ public class MetaDataRepository implemen
     public void register(Class<?> cls) {
         // buffer registered classes until an oid metadata request is made,
         // at which point we'll parse everything in the buffer
-        if (_locking) {
-            synchronized (_registered) {
-                _registered.add(cls);
-                registerAlias(cls);
-            }
-        } else {
+        synchronized (_registered) {
             _registered.add(cls);
             registerAlias(cls);
         }
@@ -1603,16 +1598,10 @@ public class MetaDataRepository implemen
         // copy into new collection to avoid concurrent mod errors on reentrant
         // registrations
         Class<?>[] reg;
-        if (_locking) {
-            synchronized (_registered) {
-                reg = _registered.toArray(new Class[_registered.size()]);
-                _registered.clear();
-            }
-        } else {
+        synchronized (_registered) {
             reg = _registered.toArray(new Class[_registered.size()]);
             _registered.clear();
         }
-        
 
         Collection<String> pcNames = getPersistentTypeNames(false, envLoader);
         Collection<Class<?>> failed = null;



Mime
View raw message