From 9e90ae52857badc193c568da91c32fcb792269e9 Mon Sep 17 00:00:00 2001 From: Redkale <22250530@qq.com> Date: Mon, 2 Apr 2018 14:08:20 +0800 Subject: [PATCH] --- src/org/redkale/source/DataJdbcSource.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/org/redkale/source/DataJdbcSource.java b/src/org/redkale/source/DataJdbcSource.java index 3b863a062..4d96152aa 100644 --- a/src/org/redkale/source/DataJdbcSource.java +++ b/src/org/redkale/source/DataJdbcSource.java @@ -89,6 +89,9 @@ public class DataJdbcSource extends AbstractService implements DataSource, DataC final AtomicInteger counter = new AtomicInteger(); this.threads = Integer.decode(readprop.getProperty(JDBC_CONNECTIONSMAX, "" + Runtime.getRuntime().availableProcessors() * 16)); + final Thread.UncaughtExceptionHandler ueh = (t, e) -> { + logger.log(Level.SEVERE, "DataJdbcSource error", e); + }; this.executor = Executors.newFixedThreadPool(threads, (Runnable r) -> { Thread t = new Thread(r); t.setDaemon(true); @@ -99,6 +102,7 @@ public class DataJdbcSource extends AbstractService implements DataSource, DataC s = "0" + s; } t.setName("DataJdbcSource-Thread-" + s); + t.setUncaughtExceptionHandler(ueh); return t; }); if (writeprop.isEmpty()) writeprop = readprop;