airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lah...@apache.org
Subject svn commit: r1386651 - in /incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main: java/org/apache/airavata/persistance/registry/jpa/impl/AiravataJPARegistry.java resources/META-INF/persistence.xml
Date Mon, 17 Sep 2012 15:13:22 GMT
Author: lahiru
Date: Mon Sep 17 15:13:21 2012
New Revision: 1386651

URL: http://svn.apache.org/viewvc?rev=1386651&view=rev
Log:
make provenance data to be saved ini to registry.

Modified:
    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/resources/META-INF/persistence.xml

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=1386651&r1=1386650&r2=1386651&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
Mon Sep 17 15:13:21 2012
@@ -757,9 +757,6 @@ public class AiravataJPARegistry extends
     }
 
     
-    private static final String PERSISTENCE_UNIT_NAME = "airavata_provenance";
-	private EntityManagerFactory factory;
-	
     @Override
 	public WorkflowExecution getWorkflowExecution(String arg0)
 			throws RegistryException {
@@ -811,7 +808,7 @@ public class AiravataJPARegistry extends
 	@Override
 	public WorkflowIOData getWorkflowExecutionOutput(String instanceID, String nodeID)
 			throws RegistryException {
-        EntityManager em = factory.createEntityManager();
+        EntityManager em = ResourceUtils.getEntityManager();
 		em.getTransaction().begin();
         Query q = em.createQuery("SELECT p FROM Node_Data p WHERE p.workflow_InstanceID =
:workflow_InstanceID AND p.node_id = :node_id");
         q.setParameter("workflow_InstanceID", instanceID);
@@ -831,7 +828,7 @@ public class AiravataJPARegistry extends
 	@Override
 	public WorkflowInstanceStatus getWorkflowExecutionStatus(String instanceID)
 			throws RegistryException {
-		EntityManager em = factory.createEntityManager();
+		EntityManager em = ResourceUtils.getEntityManager();
 		em.getTransaction().begin();
         Query q = em.createQuery("SELECT p FROM Workflow_Data p WHERE p.workflow_InstanceID
= :workflow_InstanceID");
         q.setParameter("workflow_InstanceID", instanceID);
@@ -853,7 +850,7 @@ public class AiravataJPARegistry extends
 	public boolean saveWorkflowData(WorkflowRunTimeData arg0)
 			throws RegistryException {
 		// TODO Auto-generated method stub
-		EntityManager em = factory.createEntityManager();
+		EntityManager em = ResourceUtils.getEntityManager();
 		em.getTransaction().begin();
 		Query q = em.createQuery("SELECT p FROM Experiment_Data p WHERE p.experiment_ID = :exp_ID");
 		q.setParameter("exp_ID", arg0.getExperimentID());
@@ -887,7 +884,7 @@ public class AiravataJPARegistry extends
 			throws RegistryException {
 		// TODO Auto-generated method stub
 		
-		EntityManager em = factory.createEntityManager();
+		EntityManager em = ResourceUtils.getEntityManager();
 		em.getTransaction().begin();
 		
 		Experiment_Data expData = new Experiment_Data();
@@ -920,7 +917,7 @@ public class AiravataJPARegistry extends
 	public boolean saveWorkflowExecutionServiceInput(WorkflowServiceIOData arg0)
 			throws RegistryException {
 		// TODO Auto-generated method stub
-		EntityManager em = factory.createEntityManager();
+		EntityManager em = ResourceUtils.getEntityManager();
 		em.getTransaction().begin();
 		
 		Query q = em.createQuery("SELECT w FROM Workflow_Data w WHERE w.workflow_instanceID = :workflow_ID");
@@ -947,7 +944,7 @@ public class AiravataJPARegistry extends
 			throws RegistryException {
 		// TODO Auto-generated method stub
 
-        EntityManager em = factory.createEntityManager();
+        EntityManager em = ResourceUtils.getEntityManager();
 		em.getTransaction().begin();
 		
 		Query q = em.createQuery("SELECT w FROM Workflow_Data w WHERE w.workflow_instanceID = :workflow_ID");
@@ -972,7 +969,7 @@ public class AiravataJPARegistry extends
 			throws RegistryException {
 		// TODO Auto-generated method stub
 		
-		EntityManager em = factory.createEntityManager();
+		EntityManager em = ResourceUtils.getEntityManager();
 		em.getTransaction().begin();
 		
 		Query q = em.createQuery("SELECT w FROM Workflow_Data w WHERE w.workflow_instanceID = :workflow_ID");
@@ -1006,7 +1003,7 @@ public class AiravataJPARegistry extends
 			throws RegistryException {
 		// TODO Auto-generated method stub
 		
-		EntityManager em = factory.createEntityManager();
+		EntityManager em = ResourceUtils.getEntityManager();
 		em.getTransaction().begin();
 		
 		Query q = em.createQuery("SELECT w FROM Workflow_Data w WHERE w.workflow_instanceID = :workflow_ID");
@@ -1041,7 +1038,7 @@ public class AiravataJPARegistry extends
 			ExecutionStatus arg2) throws RegistryException {
 		// TODO Auto-generated method stub
 		
-		EntityManager em = factory.createEntityManager();
+		EntityManager em = ResourceUtils.getEntityManager();
 		em.getTransaction().begin();
 		
 		Query q = em.createQuery("SELECT w FROM Workflow_Data w WHERE w.workflow_instanceID = :workflow_ID");

Modified: incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/resources/META-INF/persistence.xml
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/resources/META-INF/persistence.xml?rev=1386651&r1=1386650&r2=1386651&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/resources/META-INF/persistence.xml
(original)
+++ incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/resources/META-INF/persistence.xml
Mon Sep 17 15:13:21 2012
@@ -21,25 +21,6 @@
 * -->
 <persistence xmlns="http://java.sun.com/xml/ns/persistence"
 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0">
-	<persistence-unit name="airavata_provenance">
-		<provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
-		<class>org.apache.airavata.provenance.model.Experiment_Data</class>
-		<class>org.apache.airavata.provenance.model.Workflow_Data</class>
-		<class>org.apache.airavata.provenance.model.Node_Data</class>
-		<class>org.apache.airavata.provenance.model.Gram_Data</class>
-		<properties>
-			<property name="openjpa.ConnectionURL"
-				value="jdbc:mysql://140.182.193.104:3306/workflow_provenance" />
-			<property name="openjpa.ConnectionDriverName" value="com.mysql.jdbc.Driver" />
-			<property name="openjpa.ConnectionUserName" value="airavata" />
-			<property name="openjpa.ConnectionPassword" value="airavata" />
-			<property name="openjpa.DynamicEnhancementAgent" value="true" />
-			<property name="openjpa.RuntimeUnenhancedClasses" value="supported" />
-			<property name="openjpa.Log" value="SQL=TRACE" />
-			<property name="openjpa.ConnectionFactoryProperties"
-				value="PrettyPrint=true, PrettyPrintLineLength=72, PrintParameters=true, MaxActive=10,
MaxIdle=5, MinIdle=2, MaxWait=60000" />
-		</properties>
-	</persistence-unit>
     <persistence-unit name="airavata_data">
         <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
         <class>org.apache.airavata.persistance.registry.jpa.model.Gateway</class>
@@ -53,6 +34,10 @@
         <class>org.apache.airavata.persistance.registry.jpa.model.Service_Descriptor</class>
         <class>org.apache.airavata.persistance.registry.jpa.model.Application_Descriptor</class>
         <class>org.apache.airavata.persistance.registry.jpa.model.Experiment</class>
+        <class>org.apache.airavata.provenance.model.Experiment_Data</class>
+		<class>org.apache.airavata.provenance.model.Workflow_Data</class>
+		<class>org.apache.airavata.provenance.model.Node_Data</class>
+		<class>org.apache.airavata.provenance.model.Gram_Data</class>
         <!--properties>
             <property name="openjpa.ConnectionURL"
                       value="jdbc:mysql://localhost:3306/persitant_data" />



Mime
View raw message