You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sa...@apache.org on 2012/10/03 15:56:00 UTC

svn commit: r1393493 - in /airavata/trunk/modules: commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/ registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/

Author: samindaw
Date: Wed Oct  3 13:56:00 2012
New Revision: 1393493

URL: http://svn.apache.org/viewvc?rev=1393493&view=rev
Log:
stopping unnecessary property file loading + check to see value exist for the key b4 trying to access it

Modified:
    airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceNodeData.java
    airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/ResourceUtils.java

Modified: airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceNodeData.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceNodeData.java?rev=1393493&r1=1393492&r2=1393493&view=diff
==============================================================================
--- airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceNodeData.java (original)
+++ airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceNodeData.java Wed Oct  3 13:56:00 2012
@@ -61,7 +61,7 @@ public class    WorkflowInstanceNodeData
                 NameValue pair = null;
                 if(nameVals.length >= 2){
 				 pair = new NameValue(nameVals[0].trim(),
-						nameVals[1].trim());
+						nameVals.length>1? nameVals[1].trim():"");
                 }else if(nameVals.length == 1){
                   pair = new NameValue(nameVals[0].trim(),
 						"");

Modified: airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/ResourceUtils.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/ResourceUtils.java?rev=1393493&r1=1393492&r2=1393493&view=diff
==============================================================================
--- airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/ResourceUtils.java (original)
+++ airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/ResourceUtils.java Wed Oct  3 13:56:00 2012
@@ -39,22 +39,21 @@ public class ResourceUtils {
     private static Lock lock = new ReentrantLock();
 
     public static EntityManager getEntityManager(){
-        Map<String, String> properties = new HashMap<String, String>();
-        properties.put("openjpa.ConnectionURL", Utils.getJDBCURL());
-        properties.put("openjpa.ConnectionDriverName", Utils.getJDBCDriver());
-        properties.put("openjpa.ConnectionUserName",Utils.getJDBCUser());
-        properties.put("openjpa.ConnectionPassword",Utils.getJDBCPassword());
-        properties.put("openjpa.DynamicEnhancementAgent","true");
-        properties.put("openjpa.RuntimeUnenhancedClasses","supported");
-        properties.put("openjpa.Log","SQL=ERROR");
-        properties.put("openjpa.ReadLockLevel", "none");
-        properties.put("openjpa.WriteLockLevel", "none");
-        properties.put("openjpa.LockTimeout", "30000");
-        properties.put("openjpa.LockManager", "none");
-//        properties.put("openjpa.jdbc.Schema", "AIRAVATA");
-        properties.put("openjpa.ConnectionFactoryProperties","PrettyPrint=true, PrettyPrintLineLength=72, PrintParameters=true, MaxActive=10, MaxIdle=5, MinIdle=2, MaxWait=60000");
-
         if (factory == null) {
+            Map<String, String> properties = new HashMap<String, String>();
+            properties.put("openjpa.ConnectionURL", Utils.getJDBCURL());
+            properties.put("openjpa.ConnectionDriverName", Utils.getJDBCDriver());
+            properties.put("openjpa.ConnectionUserName",Utils.getJDBCUser());
+            properties.put("openjpa.ConnectionPassword",Utils.getJDBCPassword());
+            properties.put("openjpa.DynamicEnhancementAgent","true");
+            properties.put("openjpa.RuntimeUnenhancedClasses","supported");
+            properties.put("openjpa.Log","SQL=ERROR");
+            properties.put("openjpa.ReadLockLevel", "none");
+            properties.put("openjpa.WriteLockLevel", "none");
+            properties.put("openjpa.LockTimeout", "30000");
+            properties.put("openjpa.LockManager", "none");
+//            properties.put("openjpa.jdbc.Schema", "AIRAVATA");
+            properties.put("openjpa.ConnectionFactoryProperties","PrettyPrint=true, PrettyPrintLineLength=72, PrintParameters=true, MaxActive=10, MaxIdle=5, MinIdle=2, MaxWait=60000");
             factory = Persistence.createEntityManagerFactory(PERSISTENCE_UNIT_NAME, properties);
         }