The best way to handle it is to make the pool an active object (it should have
its own thread that comes alive every X milliseconds and does something).  This
something for a connection pool would be to have a configuration option for
idle time on the poolable objects.  

This is the standard way of doing things on the database, router tables etc. 
The pool should mimic this behavior to avoid using excess sockets, database
connections etc.


--- Rodney Waldhoff <[EMAIL PROTECTED]> wrote:
> On Thu, 23 Jan 2003, Cindy Ballreich wrote:
> 
> > Some time back I did an experiment using DBCP with Tomcat (JNDI) and
> > MySQL. I was able to get a beautiful connection pool, but the connection
> > to the database seemed to die after an extended period of idleness.
> 
> I was unable to find your previous message (in any) in the archives.
> Typically this symptom is caused by a database-level "evict idle
> connections" strategy.  One solution is to configure a validation query to
> ping the database periodically (so that the db knows the connection is
> still in use).  Another solution is to configure the pool to "test on
> borrow", so that connections that are dropped by the database are dropped
> by the pool before they are returned to your client code.  The precise
> configuration of either depends upon the specific pooling approach you're
> using (BasicDataSource, JDBC2DataSource, Pooling[Driver|DataSource], etc.)
> 
> Can you give a validation query a try, or provide more details on the
> precise problem you're having?
> 
> 
> --
> To unsubscribe, e-mail:  
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> 


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to