ode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sean...@apache.org
Subject svn commit: r781518 - in /ode/trunk: axis2-war/src/test/java/org/apache/ode/axis2/instancecleanup/ axis2-war/src/test/java/org/apache/ode/dao/jpa/ axis2-war/src/test/resources/TestCleanFault_Messages/ axis2/src/main/java/org/apache/ode/axis2/ dao-hiber...
Date Wed, 03 Jun 2009 19:31:34 GMT
Author: seanahn
Date: Wed Jun  3 19:31:33 2009
New Revision: 781518

URL: http://svn.apache.org/viewvc?rev=781518&view=rev
Log:
fixed delete_message_ldata_by_mex, mex leak

Modified:
    ode/trunk/axis2-war/src/test/java/org/apache/ode/axis2/instancecleanup/CleanFaultTest.java
    ode/trunk/axis2-war/src/test/java/org/apache/ode/dao/jpa/ProcessInstanceProfileDAOImpl.java
    ode/trunk/axis2-war/src/test/resources/TestCleanFault_Messages/deploy.xml
    ode/trunk/axis2/src/main/java/org/apache/ode/axis2/ODEService.java
    ode/trunk/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/hobj/HLargeData.java

Modified: ode/trunk/axis2-war/src/test/java/org/apache/ode/axis2/instancecleanup/CleanFaultTest.java
URL: http://svn.apache.org/viewvc/ode/trunk/axis2-war/src/test/java/org/apache/ode/axis2/instancecleanup/CleanFaultTest.java?rev=781518&r1=781517&r2=781518&view=diff
==============================================================================
--- ode/trunk/axis2-war/src/test/java/org/apache/ode/axis2/instancecleanup/CleanFaultTest.java
(original)
+++ ode/trunk/axis2-war/src/test/java/org/apache/ode/axis2/instancecleanup/CleanFaultTest.java
Wed Jun  3 19:31:33 2009
@@ -27,7 +27,7 @@
         go("TestCleanFault_Variables", 1, 0, 0, 1, 1, 0, 2, 0, 0, 0, 41, 45);
     }
 
-//    @Test(dataProvider="configs")
+    @Test(dataProvider="configs")
     public void testCleanMessages() throws Exception {
         go("TestCleanFault_Messages", 1, 0, 0, 1, 0, 0, 0, 2, 3, 2, 41, 41);
     }

Modified: ode/trunk/axis2-war/src/test/java/org/apache/ode/dao/jpa/ProcessInstanceProfileDAOImpl.java
URL: http://svn.apache.org/viewvc/ode/trunk/axis2-war/src/test/java/org/apache/ode/dao/jpa/ProcessInstanceProfileDAOImpl.java?rev=781518&r1=781517&r2=781518&view=diff
==============================================================================
--- ode/trunk/axis2-war/src/test/java/org/apache/ode/dao/jpa/ProcessInstanceProfileDAOImpl.java
(original)
+++ ode/trunk/axis2-war/src/test/java/org/apache/ode/dao/jpa/ProcessInstanceProfileDAOImpl.java
Wed Jun  3 19:31:33 2009
@@ -59,9 +59,9 @@
     
     public List<MessageExchangeDAO> findMessageExchangesByInstance() {
         List<MessageExchangeDAO> results = findByInstance("select x from MessageExchangeDAOImpl
as x where x._processInst = :instance");
-//        if( !results.isEmpty() ) {
-//            LogFactory.getLog(ProcessInstanceProfileDAOImpl.class).debug("MESSAGE_EXCHANGE
left over: " + ((MessageExchangeDAOImpl)results.get(0)).getMessageExchangeId());
-//        }
+        if( !results.isEmpty() ) {
+            LogFactory.getLog(ProcessInstanceProfileDAOImpl.class).debug("MESSAGE_EXCHANGE
left over: " + ((MessageExchangeDAOImpl)results.get(0)).getMessageExchangeId());
+        }
         
         return results;
     }

Modified: ode/trunk/axis2-war/src/test/resources/TestCleanFault_Messages/deploy.xml
URL: http://svn.apache.org/viewvc/ode/trunk/axis2-war/src/test/resources/TestCleanFault_Messages/deploy.xml?rev=781518&r1=781517&r2=781518&view=diff
==============================================================================
--- ode/trunk/axis2-war/src/test/resources/TestCleanFault_Messages/deploy.xml (original)
+++ ode/trunk/axis2-war/src/test/resources/TestCleanFault_Messages/deploy.xml Wed Jun  3 19:31:33
2009
@@ -17,20 +17,20 @@
   ~ under the License.
   -->
 <deploy xmlns="http://www.apache.org/ode/schemas/dd/2007/03"
-	xmlns:pns="http://ode/bpel/unit-test" 
-	xmlns:wns="http://ode/bpel/unit-test.wsdl" xmlns:dns="http://axis2.ode.apache.org">
+    xmlns:pns="http://ode/bpel/unit-test" 
+    xmlns:wns="http://ode/bpel/unit-test.wsdl" xmlns:dns="http://axis2.ode.apache.org">
 
 
-	<process name="pns:HelloWorld2">
-		<active>true</active>
-		<provide partnerLink="helloPartnerLink">
-			<service name="wns:HelloService" port="HelloPort"/>
-		</provide>
+    <process name="pns:HelloWorld2">
+        <active>true</active>
+        <provide partnerLink="helloPartnerLink">
+            <service name="wns:HelloService" port="HelloPort"/>
+        </provide>
         <invoke partnerLink="dummyPartnerLink">
             <service name="dns:DummyService" port="DummyServiceSOAP11port_http"/>
         </invoke>
-		<cleanup on="always">
-			<category>messages</category>
-		</cleanup>
+        <cleanup on="always">
+            <category>messages</category>
+        </cleanup>
     </process>
 </deploy>

Modified: ode/trunk/axis2/src/main/java/org/apache/ode/axis2/ODEService.java
URL: http://svn.apache.org/viewvc/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/ODEService.java?rev=781518&r1=781517&r2=781518&view=diff
==============================================================================
--- ode/trunk/axis2/src/main/java/org/apache/ode/axis2/ODEService.java (original)
+++ ode/trunk/axis2/src/main/java/org/apache/ode/axis2/ODEService.java Wed Jun  3 19:31:33
2009
@@ -41,6 +41,8 @@
 import org.apache.ode.il.epr.WSAEndpoint;
 import org.apache.ode.utils.*;
 import org.apache.ode.bpel.iapi.*;
+import org.apache.ode.bpel.iapi.MessageExchange.AckType;
+import org.apache.ode.bpel.iapi.ProcessConf.CLEANUP_CATEGORY;
 import org.apache.ode.utils.DOMUtils;
 import org.apache.ode.utils.GUID;
 import org.apache.ode.utils.Namespaces;
@@ -112,12 +114,17 @@
 
             
             if (odeMex.getOperation().getOutput() != null && outMsgContext != null)
{
-                SOAPEnvelope envelope = soapFactory.getDefaultEnvelope();
-                outMsgContext.setEnvelope(envelope);
-
-                // Hopefully we have a response
-                __log.debug("Handling response for MEX " + odeMex);
-                onResponse(odeMex, outMsgContext);
+                try {
+                    SOAPEnvelope envelope = soapFactory.getDefaultEnvelope();
+                    outMsgContext.setEnvelope(envelope);
+    
+                    // Hopefully we have a response
+                    __log.debug("Handling response for MEX " + odeMex);
+                    onResponse(odeMex, outMsgContext);
+                } finally {
+                    boolean instanceSucceeded = odeMex.getAckType() == AckType.ONEWAY ||
odeMex.getAckType() == AckType.RESPONSE;
+                    odeMex.release(_pconf.isCleanupCategoryEnabled(instanceSucceeded, CLEANUP_CATEGORY.MESSAGES));
+                }
             }
         } catch (java.util.concurrent.TimeoutException te) {
             String errmsg = "Call to " + _serviceName + "." + odeMex.getOperationName() +
" timed out(" + resolveTimeout() + " ms).";
@@ -128,7 +135,7 @@
             __log.error(errmsg, e);
             throw new OdeFault(errmsg, e);         
         } finally {
-        	// we cannot release ode mex here since it's outside of the transaction
+            // we cannot release ode mex here since it's outside of the transaction
         }
     }
 

Modified: ode/trunk/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/hobj/HLargeData.java
URL: http://svn.apache.org/viewvc/ode/trunk/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/hobj/HLargeData.java?rev=781518&r1=781517&r2=781518&view=diff
==============================================================================
--- ode/trunk/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/hobj/HLargeData.java
(original)
+++ ode/trunk/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/hobj/HLargeData.java
Wed Jun  3 19:31:33 2009
@@ -27,7 +27,7 @@
  * @hibernate.class table="LARGE_DATA"
  * @hibernate.query name="DELETE_ACTIVITY_RECOVERY_LDATA_BY_INSTANCES" query="delete from
HLargeData as d where d in(select a.details from HActivityRecovery as a where a.instance in
(:instances))"
  * @hibernate.query name="DELETE_JACOB_LDATA_BY_INSTANCES" query="delete from HLargeData
as d where d in(select i.jacobState from HProcessInstance as i where i in (:instances))"
- * @hibernate.query name="DELETE_MESSAGE_LDATA_BY_INSTANCES" query="delete from HLargeData
as d where d in(select x.request.messageData from HMessageExchange x where x.instance in(:instances))
or d in(select x.response.messageData from HMessageExchange x where x.instance in(:instances))
or d in(select x.request.header from HMessageExchange x where x.instance in (:instances))
or d in(select x.response.header from HMessageExchange x where x.instance in (:instances))"
+ * @hibernate.query name="DELETE_MESSAGE_LDATA_BY_INSTANCES" query="delete from HLargeData
as d where d in(select x.request.messageData.id from HMessageExchange x where x.instance in(:instances))
or d.id in(select x.response.messageData.id from HMessageExchange x where x.instance in(:instances))
or d.id in(select x.request.header.id from HMessageExchange x where x.instance in (:instances))
or d.id in(select x.response.header.id from HMessageExchange x where x.instance in (:instances))"
  * @hibernate.query name="DELETE_MEX_LDATA_BY_INSTANCES" query="delete from HLargeData as
d where d in(select e.endpoint from HMessageExchange as e where e.instance in (:instances))
or d IN(select e.callbackEndpoint from HMessageExchange as e where e.instance in (:instances))"
  *
  * @hibernate.query name="DELETE_EVENT_LDATA_BY_INSTANCES" query="delete from HLargeData
as d where d in(select e.data from HBpelEvent as e where e.instance in (:instances))"
@@ -35,11 +35,11 @@
  * @hibernate.query name="DELETE_XMLDATA_LDATA_BY_INSTANCES" query="delete from HLargeData
as d where d in(select x.data from HXmlData as x where x.instance in (:instances))"
  * @hibernate.query name="DELETE_PARTNER_LINK_LDATA_BY_INSTANCES" query="delete from HLargeData
as d where d in(select l.myEPR from HPartnerLink as l where l.scope.instance in (:instances))
or d IN(select l.partnerEPR from HPartnerLink as l where l.scope.instance in (:instances))"
  * @hibernate.query name="DELETE_FAULT_LDATA_BY_INSTANCE_IDS" query="delete from HLargeData
as d where d in(select f.data from HFaultData as f, HProcessInstance as i where f.id = i.fault
and i.id in (:instanceIds))"
-
- * @hibernate.query name="DELETE_MESSAGE_LDATA_BY_MEX" query="delete from HLargeData as d
where d in(select m.messageData from HMessage m, HMessageExchange x where (m = x.request or
m = x.response) and x = :mex) or d in(select m.header from HMessage m, HMessageExchange x
where (m = x.request or m = x.response) and x = :mex)"
+ * 
+ * Transitive reference of objects in select does not work for Derby; use two nested sub-selects
+ * @hibernate.query name="DELETE_MESSAGE_LDATA_BY_MEX" query="delete from HLargeData as d
where d in(select m.messageData from HMessage m where m in(select x.request from HMessageExchange
x where x = :mex) or m in(select x.response from HMessageExchange x where x = :mex)) or d
in(select m.header from HMessage m where m in(select x.request from HMessageExchange x where
x = :mex) or m in(select x.response from HMessageExchange x where x = :mex))"
  */
 public class HLargeData extends HObject {
-//@hibernate.query name="DELETE_MESSAGE_LDATA_BY_INSTANCES" query="delete from HLargeData
as d where d in(select m.messageData from HMessage m, HMessageExchange x where (m = x.request
or m = x.response) and x.instance in(:instances)) or d in(select m.header from HMessage m,
HMessageExchange x where (m = x.request or m = x.response) and x.instance in (:instances))"
     
     public final static String DELETE_ACTIVITY_RECOVERY_LDATA_BY_INSTANCES = "DELETE_ACTIVITY_RECOVERY_LDATA_BY_INSTANCES";
     public final static String DELETE_JACOB_LDATA_BY_INSTANCES = "DELETE_JACOB_LDATA_BY_INSTANCES";



Mime
View raw message