From 2425afa700ab7f1d44930f38bb03fc60f29e9a5e Mon Sep 17 00:00:00 2001 From: Eric Long Date: Mon, 2 Dec 2019 14:07:43 -0500 Subject: [PATCH] 0004175: Node communication query for unsent batches not using index on Oracle --- .../symmetric/service/impl/NodeCommunicationService.java | 4 +++- .../service/impl/NodeCommunicationServiceSqlMap.java | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/symmetric-core/src/main/java/org/jumpmind/symmetric/service/impl/NodeCommunicationService.java b/symmetric-core/src/main/java/org/jumpmind/symmetric/service/impl/NodeCommunicationService.java index d4db0a1665..b8b20cf02c 100644 --- a/symmetric-core/src/main/java/org/jumpmind/symmetric/service/impl/NodeCommunicationService.java +++ b/symmetric-core/src/main/java/org/jumpmind/symmetric/service/impl/NodeCommunicationService.java @@ -50,6 +50,7 @@ import org.jumpmind.symmetric.model.NodeCommunication; import org.jumpmind.symmetric.model.NodeCommunication.CommunicationType; import org.jumpmind.symmetric.model.NodeGroupLinkAction; +import org.jumpmind.symmetric.model.OutgoingBatch; import org.jumpmind.symmetric.model.RemoteNodeStatus; import org.jumpmind.symmetric.model.RemoteNodeStatuses; import org.jumpmind.symmetric.service.IClusterService; @@ -250,7 +251,8 @@ public List list(CommunicationType communicationType) { protected List getNodeIdsWithUnsentCount() { return sqlTemplate.query(getSql("selectNodeIdsWithUnsentBatchsSql"), - new StringMapper()); + new StringMapper(), OutgoingBatch.Status.ER, OutgoingBatch.Status.NE, OutgoingBatch.Status.QY, + OutgoingBatch.Status.SE, OutgoingBatch.Status.LD, OutgoingBatch.Status.IG, OutgoingBatch.Status.RS); } protected List filterForChannelThreading(List nodesToCommunicateWith) { diff --git a/symmetric-core/src/main/java/org/jumpmind/symmetric/service/impl/NodeCommunicationServiceSqlMap.java b/symmetric-core/src/main/java/org/jumpmind/symmetric/service/impl/NodeCommunicationServiceSqlMap.java index 35ad7eda96..e510d72558 100644 --- a/symmetric-core/src/main/java/org/jumpmind/symmetric/service/impl/NodeCommunicationServiceSqlMap.java +++ b/symmetric-core/src/main/java/org/jumpmind/symmetric/service/impl/NodeCommunicationServiceSqlMap.java @@ -34,7 +34,7 @@ public NodeCommunicationServiceSqlMap(IDatabasePlatform platform, putSql("clearLocksOnRestartSql", "update $(node_communication) set lock_time=null where locking_server_id=? and lock_time is not null"); - putSql("selectNodeIdsWithUnsentBatchsSql", "select distinct(node_id) from $(outgoing_batch) where status <> 'OK'"); + putSql("selectNodeIdsWithUnsentBatchsSql", "select distinct(node_id) from $(outgoing_batch) where status in (?,?,?,?,?,?,?)"); putSql("selectNodeCommunicationSql", "select * from $(node_communication) where communication_type=? order by node_priority DESC,last_lock_time");