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" <[EMAIL PROTECTED]> To: "Jakarta Commons Developers List" <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]> > >>Reply-To: Jakarta Commons Developers List <[EMAIL PROTECTED]> > >>To: Commons <[EMAIL PROTECTED]> > >>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: [EMAIL PROTECTED] > >For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > -- > ===================================================== > Kris Nuttycombe > Associate Scientist > Geospatial Data Services Group > CIRES, National Geophysical Data Center/NOAA > (303) 497-6337 > [EMAIL PROTECTED] > ===================================================== > > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
