From eb5fa08644f76ed10569f644dcc6fd940e9f6f59 Mon Sep 17 00:00:00 2001 From: eegeek Date: Fri, 4 Jan 2013 18:21:55 +0000 Subject: [PATCH] 0000971: Push / Pull threads should run in Job's thread when jobs.synchronized.enable is true --- .../symmetric/service/impl/NodeCommunicationService.java | 9 +++++++-- 1 file changed, 7 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 ad5b32b462..db8ae70d34 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 @@ -228,7 +228,7 @@ public boolean execute(final NodeCommunication nodeCommunication, RemoteNodeStat nodeCommunication.setLockingServerId(clusterService.getServerId()); final RemoteNodeStatus status = statuses.add(nodeCommunication.getNode()); ThreadPoolExecutor service = getExecutor(nodeCommunication.getCommunicationType()); - service.execute(new Runnable() { + Runnable r = new Runnable() { public void run() { long ts = System.currentTimeMillis(); boolean failed = false; @@ -262,7 +262,12 @@ public void run() { save(nodeCommunication); } } - }); + }; + if (parameterService.is(ParameterConstants.SYNCHRONIZE_ALL_JOBS)) { + r.run(); + } else { + service.execute(r); + } } return locked; }