From: <one...@us...> - 2003-03-26 10:48:01
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/connection In directory sc8-pr-cvs1:/tmp/cvs-serv15024/connection Modified Files: DBCPConnectionProvider.java Log Message: Alex Burgel's patch for DBCP connection validation Index: DBCPConnectionProvider.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/connection/DBCPConnectionProvider.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** DBCPConnectionProvider.java 22 Feb 2003 06:42:07 -0000 1.6 --- DBCPConnectionProvider.java 26 Mar 2003 10:47:56 -0000 1.7 *************** *** 8,11 **** --- 8,16 ---- import javax.sql.DataSource; + import net.sf.hibernate.HibernateException; + import net.sf.hibernate.cfg.Environment; + import net.sf.hibernate.util.JDBCExceptionReporter; + import net.sf.hibernate.util.PropertiesHelper; + import org.apache.commons.dbcp.ConnectionFactory; import org.apache.commons.dbcp.DriverManagerConnectionFactory; *************** *** 19,26 **** import org.apache.commons.pool.impl.GenericObjectPool; - import net.sf.hibernate.HibernateException; - import net.sf.hibernate.cfg.Environment; - import net.sf.hibernate.util.JDBCExceptionReporter; - /** * A connection provider that uses an Apache commons DBCP connection pool. Hibernate will --- 24,27 ---- *************** *** 41,45 **** final Connection c = ds.getConnection(); if (isolation!=null) c.setTransactionIsolation( isolation.intValue() ); - c.setAutoCommit(false); return c; } --- 42,45 ---- *************** *** 95,99 **** Byte.parseByte( props.getProperty(Environment.DBCP_WHENEXHAUSTED) ), Long.parseLong( props.getProperty(Environment.DBCP_MAXWAIT) ), ! Integer.parseInt( props.getProperty(Environment.DBCP_MAXIDLE) ) ); --- 95,101 ---- Byte.parseByte( props.getProperty(Environment.DBCP_WHENEXHAUSTED) ), Long.parseLong( props.getProperty(Environment.DBCP_MAXWAIT) ), ! Integer.parseInt( props.getProperty(Environment.DBCP_MAXIDLE) ), ! PropertiesHelper.getBoolean( Environment.DBCP_VALIDATION_ONBORROW, props ), ! PropertiesHelper.getBoolean( Environment.DBCP_VALIDATION_ONRETURN, props ) ); |