[openjpa] branch master updated: useless import
This is an automated email from the ASF dual-hosted git repository. rmannibucau pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/openjpa.git The following commit(s) were added to refs/heads/master by this push: new 629ebae useless import 629ebae is described below commit 629ebaefce481863ec0a154b06ef8b5ccf41a620 Author: Romain Manni-Bucau AuthorDate: Thu Oct 1 10:52:41 2020 +0200 useless import --- .../src/main/java/org/apache/openjpa/jdbc/sql/HerdDBDictionary.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/HerdDBDictionary.java b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/HerdDBDictionary.java index a9377dc..8fc3472 100644 --- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/HerdDBDictionary.java +++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/HerdDBDictionary.java @@ -18,8 +18,6 @@ */ package org.apache.openjpa.jdbc.sql; -import java.sql.Types; - /** * Dictionary for HerdDB. */
[openjpa] branch master updated: [OPENJPA-2834] also cache properties in the em - even if less useful, but no need to recompute it again and again
This is an automated email from the ASF dual-hosted git repository. rmannibucau pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/openjpa.git The following commit(s) were added to refs/heads/master by this push: new 574e226 [OPENJPA-2834] also cache properties in the em - even if less useful, but no need to recompute it again and again 574e226 is described below commit 574e226ba074dda5927623f5f1b33c009c4d1187 Author: Romain Manni-Bucau AuthorDate: Thu Oct 1 09:49:00 2020 +0200 [OPENJPA-2834] also cache properties in the em - even if less useful, but no need to recompute it again and again --- .../src/main/java/org/apache/openjpa/persistence/EntityManagerImpl.java | 1 + 1 file changed, 1 insertion(+) diff --git a/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerImpl.java b/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerImpl.java index 1a171dd..d5f78fe 100644 --- a/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerImpl.java +++ b/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerImpl.java @@ -1965,6 +1965,7 @@ public class EntityManagerImpl props.put(userKey.equals(kernelKey) ? s : userKey, JPAProperties.convertToUserValue(userKey, kvalue)); } } +properties = props; // no need to synchronize, we don't care of the actual ref, we just want it as value return props; }
[openjpa] branch master updated: [OPENJPA-2834] enable to bypass synchronizeMappings when calling getProperties
This is an automated email from the ASF dual-hosted git repository. rmannibucau pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/openjpa.git The following commit(s) were added to refs/heads/master by this push: new 0b68db6 [OPENJPA-2834] enable to bypass synchronizeMappings when calling getProperties 0b68db6 is described below commit 0b68db6ba164943d8470d46fb4de326a19fc9485 Author: Romain Manni-Bucau AuthorDate: Thu Oct 1 09:45:50 2020 +0200 [OPENJPA-2834] enable to bypass synchronizeMappings when calling getProperties --- .../apache/openjpa/persistence/EntityManagerFactoryImpl.java | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerFactoryImpl.java b/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerFactoryImpl.java index ff06de6..9242ccd 100644 --- a/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerFactoryImpl.java +++ b/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerFactoryImpl.java @@ -119,7 +119,7 @@ public class EntityManagerFactoryImpl if (emEmptyPropsProperties != null) { props.putAll(emEmptyPropsProperties); } else { -props.putAll(createEntityManager().getProperties()); +props.putAll(doCreateEM(SynchronizationType.SYNCHRONIZED, null, true).getProperties()); } // no need to sync or volatile, worse case concurrent threads create 2 instances // we just want to avoid to do it after some "init" phase @@ -198,6 +198,12 @@ public class EntityManagerFactoryImpl */ @Override public OpenJPAEntityManagerSPI createEntityManager(SynchronizationType synchronizationType, Map props) { +return doCreateEM(synchronizationType, props, false); +} + +private OpenJPAEntityManagerSPI doCreateEM(SynchronizationType synchronizationType, + Map props, + boolean byPassSynchronizeMappings) { if (synchronizationType == null) { throw new NullPointerException("SynchronizationType must not be null"); } @@ -271,7 +277,9 @@ public class EntityManagerFactoryImpl } validateCfNameProps(conf, cfName, cf2Name); -Broker broker = _factory.newBroker(user, pass, managed, retainMode, false, cfName, cf2Name); +Broker broker = byPassSynchronizeMappings ? +conf.newBrokerInstance(user, pass) : +_factory.newBroker(user, pass, managed, retainMode, false, cfName, cf2Name); // add autodetach for close and rollback conditions to the configuration broker.setAutoDetach(AutoDetach.DETACH_CLOSE, true);