commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kris Nuttycombe" <Kris.Nuttyco...@noaa.gov>
Subject Re: [dbcp] invalid connections
Date Mon, 17 Mar 2003 17:59:39 GMT
This is a question that has been coming up a lot lately, and for some 
applications, maintaining a validationQuery is not possible. Does anyone 
know if it might work to create an implementation that uses the 
Connection object's getDatabaseMetaData() method to test for the 
validity of the connection in a way that's independent of the database 
vendor and the table structure of the database?

I've been trying to resolve this issue with setting short timeouts for 
abandoned object reclamation and idle object eviction, but it is still 
possible to get bad connections from the pool.

Kris

Craig R. McClanahan wrote:

>On Fri, 14 Mar 2003, Robert McIntosh wrote:
>
>  
>
>>Date: Fri, 14 Mar 2003 21:19:28 -0600
>>From: Robert McIntosh <robert@bull-enterprises.com>
>>Reply-To: Jakarta Commons Developers List <commons-dev@jakarta.apache.org>
>>To: Commons <commons-dev@jakarta.apache.org>
>>Subject: [dbcp] invalid connections
>>
>>Is there a way to force, or configure, dbcp to either validate the
>>connections it has open, or reestablish them? The problem is that if a
>>network error occurs or the db is stoped and restarted, the connections
>>in the pool are working correctly, as they well, lose their connection.
>>
>>Any thoughts?
>>
>>    
>>
>
>This totally depends on what DBCP implementation you are using.  If you're
>using BasicDataSource (for example), this is what the "validationQuery"
>property is for.  If you are rolling your own DBCP implementation, then it
>is up to you to set an appropriate "testOnBorrow" property on the
>underlying pool implementation.
>
>  
>
>>thanks,
>>~Robert
>>    
>>
>
>Craig
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>
>
>  
>

-- 
=====================================================
Kris Nuttycombe
Associate Scientist
Geospatial Data Services Group
CIRES, National Geophysical Data Center/NOAA
(303) 497-6337
Kris.Nuttycombe@noaa.gov
=====================================================







---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message