Author: mriou
Date: Fri Jun  6 12:51:49 2008
New Revision: 664104

URL: http://svn.apache.org/viewvc?rev=664104&view=rev
Log:
Fixing the correlator route selection query so that it doesn't get confused 
when several receives are waiting for the same message with the same 
correlation but different operations.

Modified:
    
ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/CorrelatorDAOImpl.java

Modified: 
ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/CorrelatorDAOImpl.java
URL: 
http://svn.apache.org/viewvc/ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/CorrelatorDAOImpl.java?rev=664104&r1=664103&r2=664104&view=diff
==============================================================================
--- 
ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/CorrelatorDAOImpl.java 
(original)
+++ 
ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/CorrelatorDAOImpl.java 
Fri Jun  6 12:51:49 2008
@@ -36,7 +36,9 @@
 @NamedQueries({
     @NamedQuery(name="RouteByCKey", query="SELECT route " +
             "FROM MessageRouteDAOImpl as route " +
-            "WHERE route._correlationKey = :ckey and 
route._correlator._process._processType = :ptype")
+            "WHERE route._correlationKey = :ckey " +
+                   "and route._correlator._process._processType = :ptype " +
+                   "and route._correlator._correlatorId = :corrid")
         })
 public class CorrelatorDAOImpl extends OpenJPADAO implements CorrelatorDAO {
 
@@ -91,6 +93,7 @@
         Query qry = getEM().createNamedQuery("RouteByCKey");
         qry.setParameter("ckey", correlationKey.toCanonicalString());
         qry.setParameter("ptype", _process.getType().toString());
+        qry.setParameter("corrid", _correlatorId);
         List<MessageRouteDAO> routes = (List<MessageRouteDAO>) 
qry.getResultList();
         if (routes.size() > 0) return routes.get(0);
         else return null;


Reply via email to