As a follow-up to my last message, DBCP still times out, even with the validationQuery config property set. As an experiment, I modified DBCPConnectionProvider as follows:
ObjectPool connectionPool = new GenericObjectPool( null, Integer.parseInt( props.getProperty(Environment.DBCP_MAXACTIVE) ), Byte.parseByte( props.getProperty(Environment.DBCP_WHENEXHAUSTED) ), Long.parseLong( props.getProperty(Environment.DBCP_MAXWAIT) ), Integer.parseInt( props.getProperty(Environment.DBCP_MAXIDLE) ), true, true ); Note the last 2 hardcoded true parameters, indicating to test the connection on borrow and on return. This solved my problem, and I no longer get timeouts. Is there any chance of getting these as additional properties in the config file, say as hibernate.dbcp.testOnBorrow and hibernate.dbcp.testOnReturn? Say the word, and I'll take a stab at submitting a patch. Thanks, Ken -----Original Message----- From: Ken Robinson Sent: Wednesday, January 08, 2003 11:05 AM To: 'Gavin King'; [EMAIL PROTECTED] Subject: RE: [Hibernate] Problem with Connection Pool Timeouts I updated to latest CVS to take advantage of this, but a few things still jumped out at me. I noticed that testOnBorrow and testOnReturn are still marked as false inside DBCPConnectionHandler. That being the case, when is the validationQuery actually being executed to check that my connections are still valid? I'm not familiar with the workings of DBCP, and the documentation on their site is certainly less than optimal. -----Original Message----- From: Gavin King [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 07, 2003 3:42 PM To: Ken Robinson; [EMAIL PROTECTED] Subject: RE: [Hibernate] Problem with Connection Pool Timeouts