commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Juozas Baliuka" <bali...@centras.lt>
Subject Re: [dbcp] invalid connections
Date Tue, 18 Mar 2003 05:50:46 GMT
Some driver can decide to cache metadata and this will not work for
validation.
Validation query can break transactions in some situations (more side effect
than feature),
It works like roolback on erorr in transaction, you must have
"getConnection" per transaction if you use validation query,
but it can be not possible in CMT.

----- Original Message -----
From: "Kris Nuttycombe" <Kris.Nuttycombe@noaa.gov>
To: "Jakarta Commons Developers List" <commons-dev@jakarta.apache.org>
Sent: Monday, March 17, 2003 7:59 PM
Subject: Re: [dbcp] invalid connections


> 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
>


---------------------------------------------------------------------
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