On Fri, 1 Jun 2001, Ted Husted wrote:

> "Craig R. McClanahan" wrote:
> > Therefore, it seems to me that allowing the configuration of an optional
> > "do nothing" SQL command that GenericConnectionPool can use to test the
> > validity of the connection would be a better approach.  Does that make
> > sense to folks?
> 
> So, we'd add a testConnection property to control this and also provide
> a TestCommand property for the command. Then before returning a
> connection, the GCP would try the TestCommand first, and if it generates
> an exception, we discard the stale connection and get a new one. 
> 

I was thinking more along the lines of a single property
(testCommand).  If there was no such command, no test would be done.

> Do you think a default TestCommand of ";" work as a NOP ?
> 

There is no safe default for this that will work across even the few
databases I've used i the past (Oracle, Postgres, MySQL).  Therefore, I
believe the default should be "no test is performed".

> Is there a good way to get a connection to go stale, or do you just have
> to wait it out?
> 

Open some connections and then restart the database server :-).

> I've worked on this area of the code before, and could sign-up for this.
> 

That would be cool.  I'm going to cut beta-3 tonight, so if you do it
today you'll make the cut.

> 
> -- Ted Husted, Husted dot Com, Fairport NY USA.
> -- Custom Software ~ Technical Services.
> -- Tel 716 737-3463.
> -- http://www.husted.com/about/struts/
> 

Craig


Reply via email to