diff --git a/src/org/redkale/source/DataSources.java b/src/org/redkale/source/DataSources.java index 5b5d5adbd..bb9bd4ef4 100644 --- a/src/org/redkale/source/DataSources.java +++ b/src/org/redkale/source/DataSources.java @@ -23,7 +23,7 @@ public final class DataSources { public static final String JDBC_CACHE_MODE = "javax.persistence.cachemode"; - public static final String JDBC_CONNECTIONSMAX = "javax.persistence.connections.limit"; + public static final String JDBC_CONNECTIONS_LIMIT = "javax.persistence.connections.limit"; public static final String JDBC_CONNECTIONSCAPACITY = "javax.persistence.connections.bufcapacity"; diff --git a/src/org/redkale/source/DataSqlSource.java b/src/org/redkale/source/DataSqlSource.java index 4e951598b..125519b72 100644 --- a/src/org/redkale/source/DataSqlSource.java +++ b/src/org/redkale/source/DataSqlSource.java @@ -68,10 +68,10 @@ public abstract class DataSqlSource extends AbstractService implement @SuppressWarnings({"OverridableMethodCallInConstructor", "LeakingThisInConstructor"}) public DataSqlSource(String unitName, URL persistxml, Properties readprop, Properties writeprop) { final AtomicInteger counter = new AtomicInteger(); - this.threads = Integer.decode(readprop.getProperty(JDBC_CONNECTIONSMAX, "" + Runtime.getRuntime().availableProcessors() * 16)); - int maxconns = Math.max(8, Integer.decode(readprop.getProperty(JDBC_CONNECTIONSMAX, "" + Runtime.getRuntime().availableProcessors() * 200))); + this.threads = Integer.decode(readprop.getProperty(JDBC_CONNECTIONS_LIMIT, "" + Runtime.getRuntime().availableProcessors() * 16)); + int maxconns = Math.max(8, Integer.decode(readprop.getProperty(JDBC_CONNECTIONS_LIMIT, "" + Runtime.getRuntime().availableProcessors() * 200))); if (readprop != writeprop) { - this.threads += Integer.decode(writeprop.getProperty(JDBC_CONNECTIONSMAX, "" + Runtime.getRuntime().availableProcessors() * 16)); + this.threads += Integer.decode(writeprop.getProperty(JDBC_CONNECTIONS_LIMIT, "" + Runtime.getRuntime().availableProcessors() * 16)); maxconns = 0; } final String cname = this.getClass().getSimpleName(); diff --git a/src/org/redkale/source/PoolSource.java b/src/org/redkale/source/PoolSource.java index e52d8ae3a..5ee58c439 100644 --- a/src/org/redkale/source/PoolSource.java +++ b/src/org/redkale/source/PoolSource.java @@ -72,7 +72,7 @@ public abstract class PoolSource { this.connectTimeoutSeconds = Integer.decode(prop.getProperty(JDBC_CONNECTTIMEOUT_SECONDS, "3")); this.readTimeoutSeconds = Integer.decode(prop.getProperty(JDBC_READTIMEOUT_SECONDS, "3")); this.writeTimeoutSeconds = Integer.decode(prop.getProperty(JDBC_WRITETIMEOUT_SECONDS, "3")); - this.maxconns = Math.max(8, Integer.decode(prop.getProperty(JDBC_CONNECTIONSMAX, "" + Runtime.getRuntime().availableProcessors() * 100))); + this.maxconns = Math.max(8, Integer.decode(prop.getProperty(JDBC_CONNECTIONS_LIMIT, "" + Runtime.getRuntime().availableProcessors() * 100))); this.semaphore = new Semaphore(this.maxconns); String dbtype0 = ""; { //jdbc:mysql:// jdbc:microsoft:sqlserver:// 取://之前的到最后一个:之间的字符串