commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rodrigo Reyes" <rodr...@instaservi.com>
Subject Re: Using AbandonedObjectPool...
Date Wed, 09 Jul 2003 17:47:33 GMT
Simon
    That seems to be Ok. But what happens when I have a reference to the
DataSource in my app, but I have too many opened connections due to a prior
activity rise? Is there any way a connection gets closed when it has been
iddle for too much time? Wasn't that the reason for the existence of
AbandonnedObjectPool?
    I also know good code should always close its connections. Still, is
there some way to "iddle" active connections if they exceed a certain amount
of time being "active"? Thanx...

Rodrigo

----- Original Message ----- 
From: "Simon Kitching" <simon@ecnetwork.co.nz>
To: <commons-user@jakarta.apache.org>
Sent: Tuesday, July 08, 2003 6:08 PM
Subject: Re: Using AbandonedObjectPool...


> On Wed, 2003-07-09 at 09:53, David Graham wrote:
> > --- Rodrigo Reyes <rodrigo@instaservi.com> wrote:
> > > Thanx David...
> > > But if this happens, how do I close connections when the system no
> > > longer
> > > uses them?
> >
> > Your code should always close connections from the pool when it's done
> > with them.  Connections also get closed when they're garbage collected
so
> > if your app stops using the DataSource or gets shut down they will be
> > closed.
>
> Note that when you call "close" on a pooled connection, this *returns
> the connection to the pool* rather than *closing the connection to the
> database*.
>
>
> Regards,
>
> Simon
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>



Mime
View raw message