From e039b0e9f68a52120c4fb8b066dc731c35cb2877 Mon Sep 17 00:00:00 2001 From: Redkale <8730487+redkale@users.noreply.github.com> Date: Fri, 17 Aug 2018 11:26:45 +0800 Subject: [PATCH] --- src/org/redkale/source/DataSqlSource.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/org/redkale/source/DataSqlSource.java b/src/org/redkale/source/DataSqlSource.java index fe8eaef06..6151c7660 100644 --- a/src/org/redkale/source/DataSqlSource.java +++ b/src/org/redkale/source/DataSqlSource.java @@ -94,7 +94,7 @@ public abstract class DataSqlSource extends AbstractService implement return t; }); final int bufferCapacity = Math.max(8 * 1024, Integer.decode(readprop.getProperty(JDBC_CONNECTIONSCAPACITY, "" + 8 * 1024))); - this.bufferPool = new ObjectPool<>(new AtomicLong(), new AtomicLong(), this.threads, + this.bufferPool = new ObjectPool<>(new AtomicLong(), new AtomicLong(), Math.max(maxconns, this.threads * 2), (Object... params) -> ByteBuffer.allocateDirect(bufferCapacity), null, (e) -> { if (e == null || e.isReadOnly() || e.capacity() != bufferCapacity) return false; e.clear();