This commit is contained in:
Redkale
2018-04-02 14:08:20 +08:00
parent 93b1c9f0d9
commit 9e90ae5285

View File

@@ -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;