From: <one...@us...> - 2002-12-27 11:54:52
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/connection In directory sc8-pr-cvs1:/tmp/cvs-serv2878/cirrus/hibernate/connection Modified Files: DBCPConnectionProvider.java C3P0ConnectionProvider.java Log Message: added validation settings to DBCP + C3P0 connection providers added Query.setTimeout() got tests working Index: DBCPConnectionProvider.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/connection/DBCPConnectionProvider.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** DBCPConnectionProvider.java 23 Nov 2002 00:24:17 -0000 1.5 --- DBCPConnectionProvider.java 27 Dec 2002 11:54:48 -0000 1.6 *************** *** 114,118 **** // the "real" Connections created by the ConnectionFactory with // the classes that implement the pooling functionality. ! new PoolableConnectionFactory(connectionFactory, connectionPool, statementPool, null, false, false); // Finally, we create the PoolingDriver itself, --- 114,119 ---- // the "real" Connections created by the ConnectionFactory with // the classes that implement the pooling functionality. ! String validationQuery = props.getProperty(Environment.DBCP_VALIDATION_QUERY); ! new PoolableConnectionFactory(connectionFactory, connectionPool, statementPool, validationQuery, false, false); // Finally, we create the PoolingDriver itself, Index: C3P0ConnectionProvider.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/connection/C3P0ConnectionProvider.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** C3P0ConnectionProvider.java 23 Nov 2002 00:24:17 -0000 1.17 --- C3P0ConnectionProvider.java 27 Dec 2002 11:54:48 -0000 1.18 *************** *** 85,88 **** --- 85,89 ---- int maxIdleTime = PropertiesHelper.getInt(Environment.C3P0_TIMEOUT, props, 0); int maxStatements = PropertiesHelper.getInt(Environment.C3P0_MAX_STATEMENTS, props, 0); + boolean validateConnection = PropertiesHelper.getBoolean(Environment.C3P0_VALIDATE_CONNECTION, props); PoolConfig pcfg = new PoolConfig(); *************** *** 92,102 **** pcfg.setMaxIdleTime(maxIdleTime); pcfg.setMaxStatements(maxStatements); ! ! /* ! * you probabably DON'T want to uncomment ! * the next line -- it really slows down ! * Connection acquisiton. ! */ ! //pcfg.setTestConnectionOnCheckout( true ); /*DataSource unpooled = DataSources.unpooledDataSource( --- 93,97 ---- pcfg.setMaxIdleTime(maxIdleTime); pcfg.setMaxStatements(maxStatements); ! pcfg.setTestConnectionOnCheckout(validateConnection); /*DataSource unpooled = DataSources.unpooledDataSource( |