diff --git a/src/org/redkale/source/DataSqlSource.java b/src/org/redkale/source/DataSqlSource.java index 693a65a43..22dbb2588 100644 --- a/src/org/redkale/source/DataSqlSource.java +++ b/src/org/redkale/source/DataSqlSource.java @@ -89,7 +89,7 @@ public abstract class DataSqlSource extends AbstractService implement t.setUncaughtExceptionHandler(ueh); return t; }); - final int bufferCapacity = Integer.decode(readprop.getProperty(JDBC_CONNECTIONSCAPACITY, "" + 16 * 1024)); + final int bufferCapacity = Math.max(16 * 1024, Integer.decode(readprop.getProperty(JDBC_CONNECTIONSCAPACITY, "" + 16 * 1024))); this.bufferPool = new ObjectPool<>(new AtomicLong(), new AtomicLong(), this.threads, (Object... params) -> ByteBuffer.allocateDirect(bufferCapacity), null, (e) -> { if (e == null || e.isReadOnly() || e.capacity() != bufferCapacity) return false;