airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chath...@apache.org
Subject airavata git commit: JPA issues and enabling gordon mpi jobs
Date Thu, 24 Sep 2015 15:57:28 GMT
Repository: airavata
Updated Branches:
  refs/heads/master 819157476 -> d8cbbb139


JPA issues and enabling gordon mpi jobs


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

Branch: refs/heads/master
Commit: d8cbbb1392c7482caad2c1ee3ee794b1480a8d86
Parents: 8191574
Author: Chathuri Wimalasena <chathuri@apache.org>
Authored: Thu Sep 24 11:57:22 2015 -0400
Committer: Chathuri Wimalasena <chathuri@apache.org>
Committed: Thu Sep 24 11:57:22 2015 -0400

----------------------------------------------------------------------
 .../java/org/apache/airavata/gfac/core/GFacUtils.java   |  4 +++-
 .../java/org/apache/airavata/gfac/impl/SSHUtils.java    |  4 +++-
 .../experiment/catalog/impl/ExperimentRegistry.java     |  2 +-
 .../catalog/resources/ExperimentErrorResource.java      |  5 ++++-
 .../catalog/resources/ExperimentInputResource.java      |  7 +++++--
 .../catalog/resources/ExperimentOutputResource.java     |  7 +++++--
 .../catalog/resources/ExperimentResource.java           |  7 +++++--
 .../catalog/resources/ExperimentStatusResource.java     |  7 +++++--
 .../core/experiment/catalog/resources/JobResource.java  |  7 +++++--
 .../experiment/catalog/resources/JobStatusResource.java |  7 +++++--
 .../catalog/resources/ProcessErrorResource.java         |  7 +++++--
 .../catalog/resources/ProcessInputResource.java         |  7 +++++--
 .../catalog/resources/ProcessOutputResource.java        |  7 +++++--
 .../experiment/catalog/resources/ProcessResource.java   |  8 +++++---
 .../resources/ProcessResourceScheduleResource.java      |  7 +++++--
 .../catalog/resources/ProcessStatusResource.java        |  7 +++++--
 .../experiment/catalog/resources/TaskErrorResource.java |  7 +++++--
 .../core/experiment/catalog/resources/TaskResource.java |  7 +++++--
 .../catalog/resources/TaskStatusResource.java           |  7 +++++--
 .../resources/UserConfigurationDataResource.java        |  7 +++++--
 .../experiment/catalog/ExperimentInputResourceTest.java |  2 +-
 .../catalog/ExperimentOutputResourceTest.java           |  2 +-
 .../experiment/catalog/GatewayResourceTest.java         | 12 +++++++-----
 .../airavata/experiment/catalog/JobResourceTest.java    |  2 +-
 .../experiment/catalog/ProcessResourceTest.java         |  2 +-
 .../airavata/experiment/catalog/TaskResourceTest.java   |  2 +-
 .../experiment/catalog/UserConfigurationDataTest.java   |  2 +-
 .../multitenantedairavata/FrameworkBootstrapping.java   |  2 +-
 .../src/main/resources/test-framework.json              |  2 +-
 29 files changed, 106 insertions(+), 50 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/d8cbbb13/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/GFacUtils.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/GFacUtils.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/GFacUtils.java
index 5ea1ea3..3275734 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/GFacUtils.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/GFacUtils.java
@@ -811,13 +811,15 @@ public class GFacUtils {
         ApplicationParallelismType parallelism = appDepDescription.getParallelism();
         if (parallelism != null) {
             if (parallelism == ApplicationParallelismType.MPI || parallelism == ApplicationParallelismType.OPENMP || parallelism == ApplicationParallelismType.OPENMP_MPI) {
-                // FIXME this is wrong for BR2
+                // FIXME this needs to be fixed once parallaliasation retrieved by app catalog
                 if (appDepDescription.getComputeHostId().contains("stampede")){
                     jobDescriptor.setJobSubmitter("ibrun");
                 }else if (appDepDescription.getComputeHostId().contains("bigred2")){
                     jobDescriptor.setJobSubmitter("aprun -n");
                 }else if (appDepDescription.getComputeHostId().contains("comet")){
                     jobDescriptor.setJobSubmitter("mpiexec");
+                }else if (appDepDescription.getComputeHostId().contains("gordon")){
+                    jobDescriptor.setJobSubmitter(" mpirun_rsh -hostfile $PBS_NODEFILE -np");
                 }else {
                     jobDescriptor.setJobSubmitter("ibrun");
                 }

http://git-wip-us.apache.org/repos/asf/airavata/blob/d8cbbb13/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/SSHUtils.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/SSHUtils.java b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/SSHUtils.java
index 6a100a9..8a590e0 100644
--- a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/SSHUtils.java
+++ b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/SSHUtils.java
@@ -173,7 +173,9 @@ public class SSHUtils {
 			OutputStream out = channel.getOutputStream();
 			InputStream in = channel.getInputStream();
 
-			channel.connect();
+            if (!channel.isClosed()){
+                channel.connect();
+            }
 
 			byte[] buf = new byte[1024];
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/d8cbbb13/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/impl/ExperimentRegistry.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/impl/ExperimentRegistry.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/impl/ExperimentRegistry.java
index 12aebe2..d960986 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/impl/ExperimentRegistry.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/impl/ExperimentRegistry.java
@@ -746,7 +746,7 @@ public class ExperimentRegistry {
                 }
             }
         } catch (Exception e) {
-            logger.error("Error while updating experiment...", e);
+            logger.error("Error while updating process...", e);
             throw new RegistryException(e);
         }
     }

http://git-wip-us.apache.org/repos/asf/airavata/blob/d8cbbb13/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentErrorResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentErrorResource.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentErrorResource.java
index 6a049d3..7217599 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentErrorResource.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentErrorResource.java
@@ -128,7 +128,6 @@ public class ExperimentErrorResource extends AbstractExpCatResource {
         EntityManager em = null;
         try {
             em = ExpCatResourceUtils.getEntityManager();
-            em.getTransaction().begin();
             ExperimentError experimentError;
             if(experimentId == null || errorId == null){
                 throw new RegistryException("Does not have the experiment id or error id");
@@ -137,6 +136,10 @@ public class ExperimentErrorResource extends AbstractExpCatResource {
             experimentErrorPK.setExperimentId(experimentId);
             experimentErrorPK.setErrorId(errorId);
             experimentError = em.find(ExperimentError.class, experimentErrorPK);
+            em.close();
+
+            em = ExpCatResourceUtils.getEntityManager();
+            em.getTransaction().begin();
             if(experimentError == null){
                 experimentError = new ExperimentError();
             }

http://git-wip-us.apache.org/repos/asf/airavata/blob/d8cbbb13/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentInputResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentInputResource.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentInputResource.java
index e5dfa3f..2389b57 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentInputResource.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentInputResource.java
@@ -180,6 +180,10 @@ public class ExperimentInputResource extends AbstractExpCatResource {
             experimentInputPK.setExperimentId(experimentId);
             experimentInputPK.setInputName(inputName);
             experimentInput = em.find(ExperimentInput.class, experimentInputPK);
+            em.close();
+
+            em = ExpCatResourceUtils.getEntityManager();
+            em.getTransaction().begin();
             if(experimentInput == null){
                 experimentInput = new ExperimentInput();
             }
@@ -195,8 +199,7 @@ public class ExperimentInputResource extends AbstractExpCatResource {
             experimentInput.setIsRequired(isRequired);
             experimentInput.setRequiredToAddedToCmd(requiredToAddedToCmd);
             experimentInput.setDataStaged(dataStaged);
-            em.getTransaction().begin();
-            em.persist(experimentInput);
+            em.merge(experimentInput);
             em.getTransaction().commit();
             em.close();
         } catch (Exception e) {

http://git-wip-us.apache.org/repos/asf/airavata/blob/d8cbbb13/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentOutputResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentOutputResource.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentOutputResource.java
index b554174..57c28fd 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentOutputResource.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentOutputResource.java
@@ -162,6 +162,10 @@ public class ExperimentOutputResource extends AbstractExpCatResource {
             experimentOutputPK.setExperimentId(experimentId);
             experimentOutputPK.setOutputName(outputName);
             experimentOutput = em.find(ExperimentOutput.class, experimentOutputPK);
+            em.close();
+
+            em = ExpCatResourceUtils.getEntityManager();
+            em.getTransaction().begin();
             if(experimentOutput == null){
                 experimentOutput = new ExperimentOutput();
             }
@@ -175,8 +179,7 @@ public class ExperimentOutputResource extends AbstractExpCatResource {
             experimentOutput.setDataMovement(dataMovement);
             experimentOutput.setLocation(location);
             experimentOutput.setSearchQuery(searchQuery);
-            em.getTransaction().begin();
-            em.persist(experimentOutput);
+            em.merge(experimentOutput);
             em.getTransaction().commit();
             em.close();
         } catch (Exception e) {

http://git-wip-us.apache.org/repos/asf/airavata/blob/d8cbbb13/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentResource.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentResource.java
index 68f40c5..ad71f91 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentResource.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentResource.java
@@ -437,6 +437,10 @@ public class ExperimentResource extends AbstractExpCatResource {
         try {
             em = ExpCatResourceUtils.getEntityManager();
             Experiment experiment = em.find(Experiment.class, experimentId);
+            em.close();
+
+            em = ExpCatResourceUtils.getEntityManager();
+            em.getTransaction().begin();
             if (experiment == null) {
             	experiment = new Experiment();
             }
@@ -452,8 +456,7 @@ public class ExperimentResource extends AbstractExpCatResource {
             experiment.setGatewayExecutionId(gatewayExecutionId);
             experiment.setEnableEmailNotification(enableEmailNotification);
             experiment.setEmailAddresses(emailAddresses);
-            em.getTransaction().begin();
-            em.persist(experiment);
+            em.merge(experiment);
             em.getTransaction().commit();
             em.close();
         } catch (Exception e) {

http://git-wip-us.apache.org/repos/asf/airavata/blob/d8cbbb13/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentStatusResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentStatusResource.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentStatusResource.java
index 103a69e..c7242c2 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentStatusResource.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentStatusResource.java
@@ -110,7 +110,6 @@ public class ExperimentStatusResource extends AbstractExpCatResource {
         EntityManager em = null;
         try {
             em = ExpCatResourceUtils.getEntityManager();
-            em.getTransaction().begin();
             ExperimentStatus experimentStatus;
             if(experimentId == null || statusId == null){
                 throw new RegistryException("Does not have the experiment id or status id");
@@ -119,6 +118,10 @@ public class ExperimentStatusResource extends AbstractExpCatResource {
             experimentStatusPK.setStatusId(statusId);
             experimentStatusPK.setExperimentId(experimentId);
             experimentStatus = em.find(ExperimentStatus.class, experimentStatusPK);
+            em.close();
+
+            em = ExpCatResourceUtils.getEntityManager();
+            em.getTransaction().begin();
             if(experimentStatus == null){
                 experimentStatus = new ExperimentStatus();
             }
@@ -127,7 +130,7 @@ public class ExperimentStatusResource extends AbstractExpCatResource {
             experimentStatus.setState(state);
             experimentStatus.setReason(reason);
 	        experimentStatus.setTimeOfStateChange(timeOfStateChange);
-	        em.persist(experimentStatus);
+	        em.merge(experimentStatus);
             em.getTransaction().commit();
             em.close();
         } catch (Exception e) {

http://git-wip-us.apache.org/repos/asf/airavata/blob/d8cbbb13/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/JobResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/JobResource.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/JobResource.java
index 7fe29d3..abee18f 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/JobResource.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/JobResource.java
@@ -278,6 +278,10 @@ public class JobResource extends AbstractExpCatResource {
             jobPK.setJobId(jobId);
             jobPK.setProcessId(processId);
             Job job = em.find(Job.class, jobPK);
+            em.close();
+
+            em = ExpCatResourceUtils.getEntityManager();
+            em.getTransaction().begin();
             if(job == null){
                 job = new Job();
             }
@@ -298,8 +302,7 @@ public class JobResource extends AbstractExpCatResource {
             job.setJobName(jobName);
             job.setWorkingDir(workingDir);
             job.setExitCode(exitCode);
-            em.getTransaction().begin();
-            em.persist(job);
+            em.merge(job);
             em.getTransaction().commit();
             em.close();
         } catch (Exception e) {

http://git-wip-us.apache.org/repos/asf/airavata/blob/d8cbbb13/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/JobStatusResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/JobStatusResource.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/JobStatusResource.java
index c2ff7a5..3de163c 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/JobStatusResource.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/JobStatusResource.java
@@ -128,6 +128,10 @@ public class JobStatusResource extends AbstractExpCatResource {
             jobStatusPK.setStatusId(statusId);
             jobStatusPK.setProcessId(processId);
             jobStatus = em.find(JobStatus.class, jobStatusPK);
+            em.close();
+
+            em = ExpCatResourceUtils.getEntityManager();
+            em.getTransaction().begin();
             if(jobStatus == null){
                 jobStatus = new JobStatus();
             }
@@ -136,8 +140,7 @@ public class JobStatusResource extends AbstractExpCatResource {
             jobStatus.setProcessId(processId);
             jobStatus.setState(state);
             jobStatus.setReason(reason);
-            em.getTransaction().begin();
-            em.persist(jobStatus);
+            em.merge(jobStatus);
             em.getTransaction().commit();
             em.close();
         } catch (Exception e) {

http://git-wip-us.apache.org/repos/asf/airavata/blob/d8cbbb13/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessErrorResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessErrorResource.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessErrorResource.java
index a7ba797..3faa9b5 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessErrorResource.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessErrorResource.java
@@ -137,6 +137,10 @@ public class ProcessErrorResource extends AbstractExpCatResource {
             processErrorPK.setProcessId(processId);
             processErrorPK.setErrorId(errorId);
             processError = em.find(ProcessError.class, processErrorPK);
+            em.close();
+
+            em = ExpCatResourceUtils.getEntityManager();
+            em.getTransaction().begin();
             if(processError == null){
                 processError = new ProcessError();
             }
@@ -146,8 +150,7 @@ public class ProcessErrorResource extends AbstractExpCatResource {
             processError.setUserFriendlyMessage(userFriendlyMessage);
             processError.setRootCauseErrorIdList(rootCauseErrorIdList);
             processError.setTransientOrPersistent(transientOrPersistent);
-            em.persist(processError);
-            em.getTransaction().begin();
+            em.merge(processError);
             em.getTransaction().commit();
             em.close();
         } catch (Exception e) {

http://git-wip-us.apache.org/repos/asf/airavata/blob/d8cbbb13/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessInputResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessInputResource.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessInputResource.java
index eec4878..8f0531f 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessInputResource.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessInputResource.java
@@ -181,6 +181,10 @@ public class ProcessInputResource extends AbstractExpCatResource {
             processInputPk.setProcessId(processId);
             processInputPk.setInputName(inputName);
             processInput = em.find(ProcessInput.class, processInputPk);
+            em.close();
+
+            em = ExpCatResourceUtils.getEntityManager();
+            em.getTransaction().begin();
             if(processInput == null){
                 processInput = new ProcessInput();
             }
@@ -196,8 +200,7 @@ public class ProcessInputResource extends AbstractExpCatResource {
             processInput.setIsRequired(isRequired);
             processInput.setRequiredToAddedToCmd(requiredToAddedToCmd);
             processInput.setDataStaged(dataStaged);
-            em.getTransaction().begin();
-            em.persist(processInput);
+            em.merge(processInput);
             em.getTransaction().commit();
             em.close();
         } catch (Exception e) {

http://git-wip-us.apache.org/repos/asf/airavata/blob/d8cbbb13/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessOutputResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessOutputResource.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessOutputResource.java
index b1953b6..9300cfe 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessOutputResource.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessOutputResource.java
@@ -163,6 +163,10 @@ public class ProcessOutputResource extends AbstractExpCatResource {
             processOutputPK.setProcessId(processId);
             processOutputPK.setOutputName(outputName);
             processOutput = em.find(ProcessOutput.class, processOutputPK);
+            em.close();
+
+            em = ExpCatResourceUtils.getEntityManager();
+            em.getTransaction().begin();
             if(processOutput == null){
                 processOutput = new ProcessOutput();
             }
@@ -176,8 +180,7 @@ public class ProcessOutputResource extends AbstractExpCatResource {
             processOutput.setDataMovement(dataMovement);
             processOutput.setLocation(location);
             processOutput.setSearchQuery(searchQuery);
-            em.getTransaction().begin();
-            em.persist(processOutput);
+            em.merge(processOutput);
             em.getTransaction().commit();
             em.close();
         } catch (Exception e) {

http://git-wip-us.apache.org/repos/asf/airavata/blob/d8cbbb13/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessResource.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessResource.java
index 5aa8324..2cab3e9 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessResource.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessResource.java
@@ -471,8 +471,11 @@ public class ProcessResource extends AbstractExpCatResource {
         EntityManager em = null;
         try {
             em = ExpCatResourceUtils.getEntityManager();
-
             Process process = em.find(Process.class, processId);
+            em.close();
+
+            em = ExpCatResourceUtils.getEntityManager();
+            em.getTransaction().begin();
             if (process == null) {
             	process = new Process();
             }
@@ -488,8 +491,7 @@ public class ProcessResource extends AbstractExpCatResource {
             process.setGatewayExecutionId(gatewayExecutionId);
             process.setEnableEmailNotification(enableEmailNotification);
             process.setEmailAddresses(emailAddresses);
-            em.getTransaction().begin();
-            em.persist(process);
+            em.merge(process);
             em.getTransaction().commit();
             em.close();
         } catch (Exception e) {

http://git-wip-us.apache.org/repos/asf/airavata/blob/d8cbbb13/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessResourceScheduleResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessResourceScheduleResource.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessResourceScheduleResource.java
index 65ac551..0e7c4f8 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessResourceScheduleResource.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessResourceScheduleResource.java
@@ -141,6 +141,10 @@ public class ProcessResourceScheduleResource extends AbstractExpCatResource {
 
             ProcessResourceSchedule processResourceSchedule;
             processResourceSchedule = em.find(ProcessResourceSchedule.class, processId);
+            em.close();
+
+            em = ExpCatResourceUtils.getEntityManager();
+            em.getTransaction().begin();
             if(processResourceSchedule == null){
                 processResourceSchedule = new ProcessResourceSchedule();
             }
@@ -152,8 +156,7 @@ public class ProcessResourceScheduleResource extends AbstractExpCatResource {
             processResourceSchedule.setQueueName(queueName);
             processResourceSchedule.setWallTimeLimit(wallTimeLimit);
             processResourceSchedule.setTotalPhysicalMemory(totalPhysicalMemory);
-            em.getTransaction().begin();
-            em.persist(processResourceSchedule);
+            em.merge(processResourceSchedule);
             em.getTransaction().commit();
             em.close();
         } catch (Exception e) {

http://git-wip-us.apache.org/repos/asf/airavata/blob/d8cbbb13/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessStatusResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessStatusResource.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessStatusResource.java
index 894e95b..285a81e 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessStatusResource.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessStatusResource.java
@@ -119,6 +119,10 @@ public class ProcessStatusResource extends AbstractExpCatResource {
             processStatusPK.setStatusId(statusId);
             processStatusPK.setProcessId(processId);
             processStatus = em.find(ProcessStatus.class, processStatusPK);
+            em.close();
+
+            em = ExpCatResourceUtils.getEntityManager();
+            em.getTransaction().begin();
             if(processStatus == null){
                 processStatus = new ProcessStatus();
             }
@@ -126,8 +130,7 @@ public class ProcessStatusResource extends AbstractExpCatResource {
             processStatus.setProcessId(processId);
             processStatus.setState(state);
             processStatus.setReason(reason);
-            em.getTransaction().begin();
-            em.persist(processStatus);
+            em.merge(processStatus);
             em.getTransaction().commit();
             em.close();
         } catch (Exception e) {

http://git-wip-us.apache.org/repos/asf/airavata/blob/d8cbbb13/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/TaskErrorResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/TaskErrorResource.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/TaskErrorResource.java
index d93712e..5d5730f 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/TaskErrorResource.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/TaskErrorResource.java
@@ -137,6 +137,10 @@ public class TaskErrorResource extends AbstractExpCatResource {
             taskErrorPK.setTaskId(taskId);
             taskErrorPK.setErrorId(errorId);
             taskError = em.find(TaskError.class, taskErrorPK);
+            em.close();
+
+            em = ExpCatResourceUtils.getEntityManager();
+            em.getTransaction().begin();
             if(taskError == null){
                 taskError = new TaskError();
             }
@@ -147,8 +151,7 @@ public class TaskErrorResource extends AbstractExpCatResource {
             taskError.setUserFriendlyMessage(userFriendlyMessage);
             taskError.setRootCauseErrorIdList(rootCauseErrorIdList);
             taskError.setTransientOrPersistent(transientOrPersistent);
-            em.getTransaction().begin();
-            em.persist(taskError);
+            em.merge(taskError);
             em.getTransaction().commit();
             em.close();
         } catch (Exception e) {

http://git-wip-us.apache.org/repos/asf/airavata/blob/d8cbbb13/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/TaskResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/TaskResource.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/TaskResource.java
index d480597..3904283 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/TaskResource.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/TaskResource.java
@@ -276,6 +276,10 @@ public class TaskResource extends AbstractExpCatResource {
             em = ExpCatResourceUtils.getEntityManager();
 
             Task task = em.find(Task.class, taskId);
+            em.close();
+
+            em = ExpCatResourceUtils.getEntityManager();
+            em.getTransaction().begin();
             if(task == null){
                 task = new Task();
             }
@@ -286,8 +290,7 @@ public class TaskResource extends AbstractExpCatResource {
             task.setLastUpdateTime(lastUpdateTime);
             task.setTaskDetail(taskDetail);
             task.setSetSubTaskModel(subTaskModel);
-            em.getTransaction().begin();
-            em.persist(task);
+            em.merge(task);
             em.getTransaction().commit();
             em.close();
         } catch (Exception e) {

http://git-wip-us.apache.org/repos/asf/airavata/blob/d8cbbb13/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/TaskStatusResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/TaskStatusResource.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/TaskStatusResource.java
index 8f8f31f..7b3d085 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/TaskStatusResource.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/TaskStatusResource.java
@@ -119,6 +119,10 @@ public class TaskStatusResource extends AbstractExpCatResource {
             taskStatusPK.setTaskId(taskId);
             taskStatusPK.setStatusId(statusId);
             taskStatus = em.find(TaskStatus.class, taskStatusPK);
+            em.close();
+
+            em = ExpCatResourceUtils.getEntityManager();
+            em.getTransaction().begin();
             if(taskStatus == null){
                 taskStatus = new TaskStatus();
             }
@@ -127,8 +131,7 @@ public class TaskStatusResource extends AbstractExpCatResource {
             taskStatus.setState(state);
             taskStatus.setReason(reason);
             taskStatus.setTimeOfStateChange(timeOfStateChange);
-            em.getTransaction().begin();
-	        em.persist(taskStatus);
+	        em.merge(taskStatus);
             em.getTransaction().commit();
             em.close();
         } catch (Exception e) {

http://git-wip-us.apache.org/repos/asf/airavata/blob/d8cbbb13/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/UserConfigurationDataResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/UserConfigurationDataResource.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/UserConfigurationDataResource.java
index 49c9de3..f7c2090 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/UserConfigurationDataResource.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/UserConfigurationDataResource.java
@@ -195,6 +195,10 @@ public class UserConfigurationDataResource extends AbstractExpCatResource {
                 throw new RegistryException("Does not have the experiment id");
             }
             userConfigurationData = em.find(UserConfigurationData.class, experimentId);
+            em.close();
+
+            em = ExpCatResourceUtils.getEntityManager();
+            em.getTransaction().begin();
             if(userConfigurationData == null){
                 userConfigurationData = new UserConfigurationData();
             }
@@ -212,8 +216,7 @@ public class UserConfigurationDataResource extends AbstractExpCatResource {
             userConfigurationData.setQueueName(queueName);
             userConfigurationData.setWallTimeLimit(wallTimeLimit);
             userConfigurationData.setTotalPhysicalMemory(totalPhysicalMemory);
-            em.getTransaction().begin();
-            em.persist(userConfigurationData);
+            em.merge(userConfigurationData);
             em.getTransaction().commit();
             em.close();
         } catch (Exception e) {

http://git-wip-us.apache.org/repos/asf/airavata/blob/d8cbbb13/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/ExperimentInputResourceTest.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/ExperimentInputResourceTest.java b/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/ExperimentInputResourceTest.java
index 0ebaecb..ac7c5bb 100644
--- a/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/ExperimentInputResourceTest.java
+++ b/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/ExperimentInputResourceTest.java
@@ -34,7 +34,7 @@ import static org.junit.Assert.assertTrue;
 
 public class ExperimentInputResourceTest extends AbstractResourceTest  {
     private ExperimentResource experimentResource;
-    private String experimentID = "testExpID";
+    private String experimentID = "testExpID2";
     ExperimentInputResource experimentInputResource;
 
     @Override

http://git-wip-us.apache.org/repos/asf/airavata/blob/d8cbbb13/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/ExperimentOutputResourceTest.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/ExperimentOutputResourceTest.java b/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/ExperimentOutputResourceTest.java
index 937c7d8..b25e5f1 100644
--- a/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/ExperimentOutputResourceTest.java
+++ b/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/ExperimentOutputResourceTest.java
@@ -34,7 +34,7 @@ import static org.junit.Assert.assertTrue;
 
 public class ExperimentOutputResourceTest extends AbstractResourceTest  {
     private ExperimentResource experimentResource;
-    private String experimentID = "testExpID";
+    private String experimentID = "testExpID1";
     ExperimentOutputResource outputResource;
 
     @Override

http://git-wip-us.apache.org/repos/asf/airavata/blob/d8cbbb13/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/GatewayResourceTest.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/GatewayResourceTest.java b/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/GatewayResourceTest.java
index 12343d6..309df99 100644
--- a/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/GatewayResourceTest.java
+++ b/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/GatewayResourceTest.java
@@ -40,6 +40,7 @@ public class GatewayResourceTest extends AbstractResourceTest {
     private UserResource userResource;
     private WorkerResource workerResource;
     private ExperimentResource experimentResource;
+    private String testExpID = "testExpID3";
 
 
     @Override
@@ -61,7 +62,8 @@ public class GatewayResourceTest extends AbstractResourceTest {
 
         experimentResource = (ExperimentResource) gatewayResource.create(ResourceType.EXPERIMENT);
 
-        experimentResource.setExperimentId("testExpID");
+
+        experimentResource.setExperimentId(testExpID);
         experimentResource.setUserName(getWorkerResource().getUser());
         experimentResource.setProjectId(getProjectResource().getId());
         experimentResource.setCreationTime(currentDate);
@@ -91,13 +93,13 @@ public class GatewayResourceTest extends AbstractResourceTest {
     @Test
     public void testIsExists() throws Exception {
         assertTrue(gatewayResource.isExists(ResourceType.GATEWAY_WORKER, ServerSettings.getDefaultUser()));
-        assertTrue(gatewayResource.isExists(ResourceType.EXPERIMENT, "testExpID"));
+        assertTrue(gatewayResource.isExists(ResourceType.EXPERIMENT, testExpID));
     }
 
     @Test
     public void testGet() throws Exception {
         assertNotNull(gatewayResource.get(ResourceType.GATEWAY_WORKER, ServerSettings.getDefaultUser()));
-        assertNotNull(gatewayResource.get(ResourceType.EXPERIMENT, "testExpID"));
+        assertNotNull(gatewayResource.get(ResourceType.EXPERIMENT, testExpID));
     }
 
     @Test
@@ -109,8 +111,8 @@ public class GatewayResourceTest extends AbstractResourceTest {
     @Test
     public void testRemove() throws Exception {
 
-        gatewayResource.remove(ResourceType.EXPERIMENT, "testExpID");
-        assertFalse(gatewayResource.isExists(ResourceType.EXPERIMENT, "testExpID"));
+        gatewayResource.remove(ResourceType.EXPERIMENT, testExpID);
+        assertFalse(gatewayResource.isExists(ResourceType.EXPERIMENT, testExpID));
 
     }
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/d8cbbb13/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/JobResourceTest.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/JobResourceTest.java b/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/JobResourceTest.java
index 1bbf7d7..ede0278 100644
--- a/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/JobResourceTest.java
+++ b/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/JobResourceTest.java
@@ -40,7 +40,7 @@ public class JobResourceTest extends AbstractResourceTest{
 	   private ProcessResource processResource;
 	   private TaskResource taskResource;
        private JobResource jobResource;
-       private String experimentID = "testExpID";
+       private String experimentID = "testExpID4";
 	   private String processId = "processID";
        private String taskId = "taskID";
        private String jobId = "jobID";

http://git-wip-us.apache.org/repos/asf/airavata/blob/d8cbbb13/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/ProcessResourceTest.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/ProcessResourceTest.java b/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/ProcessResourceTest.java
index 6349007..0474cf0 100644
--- a/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/ProcessResourceTest.java
+++ b/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/ProcessResourceTest.java
@@ -34,7 +34,7 @@ public class ProcessResourceTest extends AbstractResourceTest{
 	
 	   private ExperimentResource experimentResource;
 	   private ProcessResource processResource;
-	   private String experimentID = "testExpID";
+	   private String experimentID = "testExpID5";
 	   private String processId = "processID";
 
 	

http://git-wip-us.apache.org/repos/asf/airavata/blob/d8cbbb13/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/TaskResourceTest.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/TaskResourceTest.java b/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/TaskResourceTest.java
index 85d3501..5821a06 100644
--- a/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/TaskResourceTest.java
+++ b/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/TaskResourceTest.java
@@ -38,7 +38,7 @@ public class TaskResourceTest extends AbstractResourceTest{
 	   private ExperimentResource experimentResource;
 	   private ProcessResource processResource;
 	   private TaskResource taskResource;
-       private String experimentID = "testExpID";
+       private String experimentID = "testExpID6";
 	   private String processId = "processID";
        private String taskId = "taskID";
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/d8cbbb13/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/UserConfigurationDataTest.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/UserConfigurationDataTest.java b/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/UserConfigurationDataTest.java
index 6387aa8..0d0072d 100644
--- a/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/UserConfigurationDataTest.java
+++ b/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/UserConfigurationDataTest.java
@@ -37,7 +37,7 @@ import static org.junit.Assert.assertTrue;
 public class UserConfigurationDataTest extends AbstractResourceTest {
     private ExperimentResource experimentResource;
     private UserConfigurationDataResource userConfigurationData;
-    private String experimentID = "testExpID";
+    private String experimentID = "testExpID7";
 
     @Override
     @Before

http://git-wip-us.apache.org/repos/asf/airavata/blob/d8cbbb13/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/FrameworkBootstrapping.java
----------------------------------------------------------------------
diff --git a/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/FrameworkBootstrapping.java b/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/FrameworkBootstrapping.java
index 3f6c73f..d3068d8 100644
--- a/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/FrameworkBootstrapping.java
+++ b/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/FrameworkBootstrapping.java
@@ -60,7 +60,7 @@ public class FrameworkBootstrapping {
                 logger.info("Applications registered for each each gateway...");
                 experimentExecution = new ExperimentExecution(setup.getAiravata(), tokens, properties);
                 experimentExecution.createEchoExperiment();
-                experimentExecution.createAmberExperiment();
+//                experimentExecution.createAmberExperiment();
                 experimentExecution.launchExperiments();
                 experimentExecution.monitorExperiments();
             }else if (regApps){

http://git-wip-us.apache.org/repos/asf/airavata/blob/d8cbbb13/modules/test-suite/multi-tenanted-airavata/src/main/resources/test-framework.json
----------------------------------------------------------------------
diff --git a/modules/test-suite/multi-tenanted-airavata/src/main/resources/test-framework.json b/modules/test-suite/multi-tenanted-airavata/src/main/resources/test-framework.json
index 6f9183c..5b674f9 100644
--- a/modules/test-suite/multi-tenanted-airavata/src/main/resources/test-framework.json
+++ b/modules/test-suite/multi-tenanted-airavata/src/main/resources/test-framework.json
@@ -32,7 +32,7 @@
     ],
     "applications": [
         {
-            "name": "amber_sander",
+            "name": "Amber_Sander",
             "inputs": {
                 "Heat-Restart-File": "/Users/chathuri/dev/airavata/source/php/inputs/AMBER_FILES1/02_Heat.rst",
                 "Parameter-Topology-File": "/Users/chathuri/dev/airavata/source/php/inputs/AMBER_FILES1/03_Prod.in",


Mime
View raw message