airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shame...@apache.org
Subject airavata git commit: Create only one EntityManageFactor in runtime
Date Wed, 30 Sep 2015 19:19:58 GMT
Repository: airavata
Updated Branches:
  refs/heads/master 5b4cfc9e7 -> e3ec7fef9


Create only one EntityManageFactor in runtime


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/e3ec7fef
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/e3ec7fef
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/e3ec7fef

Branch: refs/heads/master
Commit: e3ec7fef909e49242f1e3fd6fcf83d9063764a69
Parents: 5b4cfc9
Author: Shameera Rathnayaka <shameerainfo@gmail.com>
Authored: Wed Sep 30 15:19:52 2015 -0400
Committer: Shameera Rathnayaka <shameerainfo@gmail.com>
Committed: Wed Sep 30 15:19:52 2015 -0400

----------------------------------------------------------------------
 .../registry/core/experiment/catalog/ExpCatResourceUtils.java  | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/e3ec7fef/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/ExpCatResourceUtils.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/ExpCatResourceUtils.java
b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/ExpCatResourceUtils.java
index 64ed997..075684d 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/ExpCatResourceUtils.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/ExpCatResourceUtils.java
@@ -62,7 +62,11 @@ public class ExpCatResourceUtils {
             properties.put("openjpa.jdbc.SynchronizeMappings", "buildSchema(ForeignKeys=true)");
             properties.put("openjpa.ConnectionFactoryProperties", "PrettyPrint=true, PrettyPrintLineLength=72,
PrintParameters=true, MaxActive=10, MaxIdle=5, MinIdle=2, MaxWait=31536000,  autoReconnect=true");
 			properties.put("openjpa.jdbc.QuerySQLCache", "false");
-            expCatFactory = Persistence.createEntityManagerFactory(PERSISTENCE_UNIT_NAME,
properties);
+            synchronized (ExpCatResourceUtils.class) {
+                if (expCatFactory == null) {
+                    expCatFactory = Persistence.createEntityManagerFactory(PERSISTENCE_UNIT_NAME,
properties);
+                }
+            }
         }
         expCatEntityManager = expCatFactory.createEntityManager();
         return expCatEntityManager;


Mime
View raw message