airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lah...@apache.org
Subject svn commit: r1384472 - in /incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa: ./ impl/ model/ resources/
Date Thu, 13 Sep 2012 19:01:56 GMT
Author: lahiru
Date: Thu Sep 13 19:01:56 2012
New Revision: 1384472

URL: http://svn.apache.org/viewvc?rev=1384472&view=rev
Log:
applying AIRAVATA-562.13.patch for AIRAVATA-562

Modified:
    incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/ResourceUtils.java
    incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/AiravataJPARegistry.java
    incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/Application_Descriptor.java
    incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ConfigurationResource.java

Modified: incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/ResourceUtils.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/ResourceUtils.java?rev=1384472&r1=1384471&r2=1384472&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/ResourceUtils.java
(original)
+++ incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/ResourceUtils.java
Thu Sep 13 19:01:56 2012
@@ -47,6 +47,9 @@ public class ResourceUtils {
         properties.put("openjpa.DynamicEnhancementAgent","true");
         properties.put("openjpa.RuntimeUnenhancedClasses","supported");
         properties.put("openjpa.Log","SQL=TRACE");
+        properties.put("openjpa.ReadLockLevel", "none");
+        properties.put("openjpa.WriteLockLevel", "none");
+        properties.put("openjpa.LockTimeout", "30000");
         properties.put("openjpa.LockManager", "none");
         properties.put("openjpa.ConnectionFactoryProperties","PrettyPrint=true, PrettyPrintLineLength=72,
PrintParameters=true, MaxActive=10, MaxIdle=5, MinIdle=2, MaxWait=60000");
 

Modified: incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/AiravataJPARegistry.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/AiravataJPARegistry.java?rev=1384472&r1=1384471&r2=1384472&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/AiravataJPARegistry.java
(original)
+++ incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/AiravataJPARegistry.java
Thu Sep 13 19:01:56 2012
@@ -327,11 +327,13 @@ public class AiravataJPARegistry extends
     
     public void addServiceDescriptor(ServiceDescription descriptor) throws RegistryException
{
     	GatewayResource gateway = jpa.getGateway();
+        WorkerResource workerResource = jpa.getWorker();
         String serviceName = descriptor.getType().getName();
 		if (isServiceDescriptorExists(serviceName)){
         	throw new DescriptorAlreadyExistsException(serviceName);
         }
         ServiceDescriptorResource serviceDescriptorResource = gateway.createServiceDescriptorResource(serviceName);
+        serviceDescriptorResource.setUserName(workerResource.getUser());
         serviceDescriptorResource.setContent(descriptor.toXML());
         serviceDescriptorResource.save();
     }
@@ -405,12 +407,14 @@ public class AiravataJPARegistry extends
 
     public void addApplicationDescriptor(String serviceName, String hostName, ApplicationDeploymentDescription
descriptor) throws RegistryException {
     	GatewayResource gateway = jpa.getGateway();
+        WorkerResource workerResource = jpa.getWorker();
         String applicationName = descriptor.getType().getApplicationName().getStringValue();
         applicationName = createAppName(serviceName, hostName, applicationName);
 		if (isApplicationDescriptorExists(serviceName,hostName,descriptor.getType().getApplicationName().getStringValue())){
         	throw new DescriptorAlreadyExistsException(applicationName);
         }
         ApplicationDescriptorResource applicationDescriptorResource = gateway.createApplicationDescriptorResource(applicationName);
+        applicationDescriptorResource.setUpdatedUser(workerResource.getUser());
         applicationDescriptorResource.setServiceDescName(serviceName);
         applicationDescriptorResource.setHostDescName(hostName);
         applicationDescriptorResource.setContent(descriptor.toXML());

Modified: incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/Application_Descriptor.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/Application_Descriptor.java?rev=1384472&r1=1384471&r2=1384472&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/Application_Descriptor.java
(original)
+++ incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/Application_Descriptor.java
Thu Sep 13 19:01:56 2012
@@ -37,11 +37,11 @@ public class Application_Descriptor {
 
     private String application_descriptor_xml;
 
-    @ManyToOne
+    @ManyToOne(cascade=CascadeType.MERGE)
     @JoinColumn(name = "gateway_name")
     private Gateway gateway;
 
-    @ManyToOne
+    @ManyToOne(cascade=CascadeType.MERGE)
     @JoinColumn(name = "updated_user", referencedColumnName = "user_name")
     private Users user;
 

Modified: incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ConfigurationResource.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ConfigurationResource.java?rev=1384472&r1=1384471&r2=1384472&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ConfigurationResource.java
(original)
+++ incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ConfigurationResource.java
Thu Sep 13 19:01:56 2012
@@ -156,7 +156,7 @@ public class ConfigurationResource exten
             if(existing != null){
                configuration = em.merge(existing);
             }  else {
-                em.persist(configuration);
+                em.merge(configuration);
             }
 
             em.getTransaction().commit();



Mime
View raw message