IDEMPIERE-3830 c3p0 defaults are not exploiting the power of c3p0 reliability

This commit is contained in:
Carlos Ruiz 2018-11-28 22:17:48 +01:00
parent 5d31f298fd
commit ac14fcd294
7 changed files with 9 additions and 9 deletions

View File

@ -305,7 +305,7 @@ public interface AdempiereDatabase
/** /**
* Default sql use to test whether a connection is still valid * Default sql use to test whether a connection is still valid
*/ */
public final static String DEFAULT_CONN_TEST_SQL = "SELECT Version FROM AD_System"; //public final static String DEFAULT_CONN_TEST_SQL = "SELECT Version FROM AD_System";
/** /**
* Is the database have sql extension that return a subset of the query result * Is the database have sql extension that return a subset of the query result

View File

@ -12,5 +12,5 @@ MinPoolSize=1
#flag #flag
TestConnectionOnCheckin=false TestConnectionOnCheckin=false
TestConnectionOnCheckout=false TestConnectionOnCheckout=true
#CheckoutTimeout=60; #CheckoutTimeout=60;

View File

@ -13,6 +13,6 @@ MaxStatementsPerConnection=30
#flag #flag
TestConnectionOnCheckin=false TestConnectionOnCheckin=false
TestConnectionOnCheckout=false TestConnectionOnCheckout=true
#CheckoutTimeout=60; #CheckoutTimeout=60;
com.mchange.v2.log.MLog=com.mchange.v2.log.slf4j.Slf4jMLog com.mchange.v2.log.MLog=com.mchange.v2.log.slf4j.Slf4jMLog

View File

@ -664,7 +664,7 @@ public class DB_Oracle implements AdempiereDatabase
int maxIdleTime = getIntProperty(poolProperties, "MaxIdleTime", 1200); int maxIdleTime = getIntProperty(poolProperties, "MaxIdleTime", 1200);
int unreturnedConnectionTimeout = getIntProperty(poolProperties, "UnreturnedConnectionTimeout", 0); int unreturnedConnectionTimeout = getIntProperty(poolProperties, "UnreturnedConnectionTimeout", 0);
boolean testConnectionOnCheckin = getBooleanProperty(poolProperties, "TestConnectionOnCheckin", false); boolean testConnectionOnCheckin = getBooleanProperty(poolProperties, "TestConnectionOnCheckin", false);
boolean testConnectionOnCheckout = getBooleanProperty(poolProperties, "TestConnectionOnCheckout", false); boolean testConnectionOnCheckout = getBooleanProperty(poolProperties, "TestConnectionOnCheckout", true);
String mlogClass = getStringProperty(poolProperties, "com.mchange.v2.log.MLog", "com.mchange.v2.log.FallbackMLog"); String mlogClass = getStringProperty(poolProperties, "com.mchange.v2.log.MLog", "com.mchange.v2.log.FallbackMLog");
int checkoutTimeout = getIntProperty(poolProperties, "CheckoutTimeout", 0); int checkoutTimeout = getIntProperty(poolProperties, "CheckoutTimeout", 0);
int statementCacheNumDeferredCloseThreads = getIntProperty(poolProperties, "StatementCacheNumDeferredCloseThreads", 0); int statementCacheNumDeferredCloseThreads = getIntProperty(poolProperties, "StatementCacheNumDeferredCloseThreads", 0);
@ -679,7 +679,7 @@ public class DB_Oracle implements AdempiereDatabase
cpds.setJdbcUrl(getConnectionURL(connection)); cpds.setJdbcUrl(getConnectionURL(connection));
cpds.setUser(connection.getDbUid()); cpds.setUser(connection.getDbUid());
cpds.setPassword(connection.getDbPwd()); cpds.setPassword(connection.getDbPwd());
cpds.setPreferredTestQuery(DEFAULT_CONN_TEST_SQL); //cpds.setPreferredTestQuery(DEFAULT_CONN_TEST_SQL);
cpds.setIdleConnectionTestPeriod(idleConnectionTestPeriod); cpds.setIdleConnectionTestPeriod(idleConnectionTestPeriod);
cpds.setAcquireRetryAttempts(acquireRetryAttempts); cpds.setAcquireRetryAttempts(acquireRetryAttempts);
cpds.setTestConnectionOnCheckin(testConnectionOnCheckin); cpds.setTestConnectionOnCheckin(testConnectionOnCheckin);

View File

@ -12,5 +12,5 @@ MinPoolSize=1
#flag #flag
TestConnectionOnCheckin=false TestConnectionOnCheckin=false
TestConnectionOnCheckout=false TestConnectionOnCheckout=true
#CheckoutTimeout=60; #CheckoutTimeout=60;

View File

@ -14,6 +14,6 @@ MaxStatementsPerConnection=30
#flag #flag
TestConnectionOnCheckin=false TestConnectionOnCheckin=false
TestConnectionOnCheckout=false TestConnectionOnCheckout=true
#CheckoutTimeout=60; #CheckoutTimeout=60;
com.mchange.v2.log.MLog=com.mchange.v2.log.slf4j.Slf4jMLog com.mchange.v2.log.MLog=com.mchange.v2.log.slf4j.Slf4jMLog

View File

@ -756,7 +756,7 @@ public class DB_PostgreSQL implements AdempiereDatabase
int maxIdleTime = getIntProperty(poolProperties, "MaxIdleTime", 1200); int maxIdleTime = getIntProperty(poolProperties, "MaxIdleTime", 1200);
int unreturnedConnectionTimeout = getIntProperty(poolProperties, "UnreturnedConnectionTimeout", 0); int unreturnedConnectionTimeout = getIntProperty(poolProperties, "UnreturnedConnectionTimeout", 0);
boolean testConnectionOnCheckin = getBooleanProperty(poolProperties, "TestConnectionOnCheckin", false); boolean testConnectionOnCheckin = getBooleanProperty(poolProperties, "TestConnectionOnCheckin", false);
boolean testConnectionOnCheckout = getBooleanProperty(poolProperties, "TestConnectionOnCheckout", false); boolean testConnectionOnCheckout = getBooleanProperty(poolProperties, "TestConnectionOnCheckout", true);
String mlogClass = getStringProperty(poolProperties, "com.mchange.v2.log.MLog", "com.mchange.v2.log.FallbackMLog"); String mlogClass = getStringProperty(poolProperties, "com.mchange.v2.log.MLog", "com.mchange.v2.log.FallbackMLog");
int checkoutTimeout = getIntProperty(poolProperties, "CheckoutTimeout", 0); int checkoutTimeout = getIntProperty(poolProperties, "CheckoutTimeout", 0);
@ -772,7 +772,7 @@ public class DB_PostgreSQL implements AdempiereDatabase
cpds.setJdbcUrl(getConnectionURL(connection)); cpds.setJdbcUrl(getConnectionURL(connection));
cpds.setUser(connection.getDbUid()); cpds.setUser(connection.getDbUid());
cpds.setPassword(connection.getDbPwd()); cpds.setPassword(connection.getDbPwd());
cpds.setPreferredTestQuery(DEFAULT_CONN_TEST_SQL); //cpds.setPreferredTestQuery(DEFAULT_CONN_TEST_SQL);
cpds.setIdleConnectionTestPeriod(idleConnectionTestPeriod); cpds.setIdleConnectionTestPeriod(idleConnectionTestPeriod);
cpds.setMaxIdleTimeExcessConnections(maxIdleTimeExcessConnections); cpds.setMaxIdleTimeExcessConnections(maxIdleTimeExcessConnections);
cpds.setMaxIdleTime(maxIdleTime); cpds.setMaxIdleTime(maxIdleTime);