Author: mriou
Date: Fri Jun 6 12:38:25 2008
New Revision: 664098
URL: http://svn.apache.org/viewvc?rev=664098&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/branches/APACHE_ODE_1.1/dao-jpa/src/main/java/org/apache/ode/dao/jpa/CorrelatorDAOImpl.java
Modified:
ode/branches/APACHE_ODE_1.1/dao-jpa/src/main/java/org/apache/ode/dao/jpa/CorrelatorDAOImpl.java
URL:
http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.1/dao-jpa/src/main/java/org/apache/ode/dao/jpa/CorrelatorDAOImpl.java?rev=664098&r1=664097&r2=664098&view=diff
==============================================================================
---
ode/branches/APACHE_ODE_1.1/dao-jpa/src/main/java/org/apache/ode/dao/jpa/CorrelatorDAOImpl.java
(original)
+++
ode/branches/APACHE_ODE_1.1/dao-jpa/src/main/java/org/apache/ode/dao/jpa/CorrelatorDAOImpl.java
Fri Jun 6 12:38:25 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 {
@@ -90,9 +92,11 @@
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;
+ if (routes.size() > 0) {
+ return routes.get(0);
+ } else return null;
}
public String getCorrelatorId() {