From db154e11b7a7d255196a54be75e080c00ee07e51 Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Mon, 3 Dec 2012 14:37:46 +0800 Subject: [PATCH] IDEMPIERE-502 Use single thread pool for client and server process. Fixed scheduled thread pool executor service doesn't use min pool size and shouldn't have core thread timeout. --- .../src/org/compiere/Adempiere.java | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/Adempiere.java b/org.adempiere.base/src/org/compiere/Adempiere.java index dc483443c0..220ac1cc87 100644 --- a/org.adempiere.base/src/org/compiere/Adempiere.java +++ b/org.adempiere.base/src/org/compiere/Adempiere.java @@ -554,37 +554,20 @@ public final class Adempiere private static void createThreadPool() { int max = Runtime.getRuntime().availableProcessors() * 20; - int min = max / 2; int defaultMax = max; - int defaultMin = min; Properties properties = Ini.getProperties(); String maxSize = properties.getProperty("MaxThreadPoolSize"); - String minSize = properties.getProperty("MinThreadPoolSize"); if (maxSize != null) { try { max = Integer.parseInt(maxSize); } catch (Exception e) {} } - if (minSize != null) { - try { - min = Integer.parseInt(minSize); - } catch (Exception e) {} - } - if (max < min) { - max = min; - } if (max <= 0) { max = defaultMax; } - if (min < 0) { - min = defaultMin; - } // start thread pool - threadPoolExecutor = new ScheduledThreadPoolExecutor(min); - threadPoolExecutor.setMaximumPoolSize(max); - threadPoolExecutor.setKeepAliveTime(10, TimeUnit.MINUTES); - threadPoolExecutor.allowCoreThreadTimeOut(true); + threadPoolExecutor = new ScheduledThreadPoolExecutor(max); Trx.startTrxMonitor(); }