# HG changeset patch
# User Ranjith S R <ranjith@qualiantech.com>
# Date 1557990119 -19800
#      Thu May 16 12:31:59 2019 +0530
# Node ID b0c3b12f7a26338a21dbafb1eb197e8a0b8f3e1f
# Parent  cb413503e4095e67d50c71e3ef00c9b42b576942
Related to issue 40571 : ServerStateBackground.getServerstoSendPing is not using bind-parameters

diff -r cb413503e409 -r b0c3b12f7a26 src/org/openbravo/mobile/core/servercontroller/ServerStateBackground.java
--- a/src/org/openbravo/mobile/core/servercontroller/ServerStateBackground.java	Thu May 16 12:30:59 2019 +0530
+++ b/src/org/openbravo/mobile/core/servercontroller/ServerStateBackground.java	Thu May 16 12:31:59 2019 +0530
@@ -401,15 +401,16 @@
       throw new OBException("This method should only be called in the central server");
     }
     OBQuery<MobileServerDefinition> serversQry = OBDal.getInstance()
-        .createQuery(MobileServerDefinition.class,
-            "client.id=:clientId and " + MobileServerDefinition.PROPERTY_MOBILESERVERKEY + "!='"
-                + thisServerDef.getMobileServerKey() + "' and "
-                + MobileServerDefinition.PROPERTY_SERVERTYPE + "='" + MobileServerUtils.STORE_SERVER
-                + "'" + " order by " + MobileServerDefinition.PROPERTY_PRIORITY);
+        .createQuery(MobileServerDefinition.class, "client.id=:clientId and "//
+            + MobileServerDefinition.PROPERTY_MOBILESERVERKEY + "!=:mobileServerKey and "//
+            + MobileServerDefinition.PROPERTY_SERVERTYPE + "=:serverType "//
+            + "order by " + MobileServerDefinition.PROPERTY_PRIORITY);
     serversQry.setFilterOnReadableClients(false);
     serversQry.setFilterOnReadableOrganization(false);
     serversQry.setNamedParameter("clientId",
         MobileServerController.getInstance().getThisServerClientId());
+    serversQry.setNamedParameter("mobileServerKey", thisServerDef.getMobileServerKey());
+    serversQry.setNamedParameter("serverType", MobileServerUtils.STORE_SERVER);
     return serversQry.list();
   }
 
