openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p..@apache.org
Subject svn commit: r597002 - /openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/JDBCBrokerFactory.java
Date Wed, 21 Nov 2007 09:20:56 GMT
Author: pcl
Date: Wed Nov 21 01:20:56 2007
New Revision: 597002

URL: http://svn.apache.org/viewvc?rev=597002&view=rev
Log:
While looking at dynamic class loading, I noticed that we create a separate MappingRepository
when doing an in-process schema redefinion. This seems to lead to potentially-out-of-sync
states in the main configuration MappingRepository; this change shares the Configuration's
repository with the MappingTool.

It looks like the old behavior was somewhat implicit, so I'm hoping that it wasn't necessary,
and that this change will be a step forward.

Modified:
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/JDBCBrokerFactory.java

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/JDBCBrokerFactory.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/JDBCBrokerFactory.java?rev=597002&r1=597001&r2=597002&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/JDBCBrokerFactory.java
(original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/JDBCBrokerFactory.java
Wed Nov 21 01:20:56 2007
@@ -26,6 +26,7 @@
 import org.apache.commons.lang.StringUtils;
 import org.apache.openjpa.jdbc.conf.JDBCConfiguration;
 import org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl;
+import org.apache.openjpa.jdbc.meta.MappingRepository;
 import org.apache.openjpa.jdbc.meta.MappingTool;
 import org.apache.openjpa.kernel.AbstractBrokerFactory;
 import org.apache.openjpa.kernel.Bootstrap;
@@ -145,14 +146,16 @@
         if (StringUtils.isEmpty(action))
             return;
 
-        Collection classes = conf.getMetaDataRepositoryInstance().
-            loadPersistentTypes(false, loader);
+        MappingRepository repo = conf.getMappingRepositoryInstance();
+        Collection classes = repo.loadPersistentTypes(false, loader);
         if (classes.isEmpty())
             return;
 
         String props = Configurations.getProperties(action);
         action = Configurations.getClassName(action);
         MappingTool tool = new MappingTool(conf, action, false);
+        tool.setRepository(repo);
+        tool.setSchemaGroup(tool.getSchemaGroup());
         Configurations.configureInstance(tool, conf, props,
             "SynchronizeMappings");
 



Mime
View raw message