You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by al...@abnamro.com on 2001/10/17 19:57:51 UTC

database connection pool design

Hi

I'm trying to use Turbine database connection pool in my Tomcat-based
application. So far it works ok
but I have several questions regarding the pool design. My main concern is
connection expiration algorithm.
As far as I understand from the source code expired/not-expired condition
is only checked when the connection
is being returned back to the pool. But that means that if the web
application has big number of users accessing
it at some moment, it's going to establish many connections. And if later
(but before expiration time is up)
the number of users drops (end of day) then majority of the connections
won't be closed until somebody
starts (actively!) using the application again.

The more desirable behavior would be to have separate thread monitoring
unused connections periodically
and closing them upon expiration. Is something like this planned for future
releases? Or please correct me
if I'm wrong.

Another question is why the expiration time starts counting starting from a
connection creation and not from
the moment it's returned to the pool. What's wrong with long living
connections?

Thanks in advance,
Alexander Vorobiev
---------------------------------------------------------------------------
This  message  (including  any  attachments)  is  confidential  and  may be
privileged.  If you have received it by mistake please notify the sender by
return  e-mail  and  delete this message from your system. Any unauthorized
use  or  dissemination  of  this  message  in  whole or in part is strictly
prohibited.  Please  note  that e-mails are susceptible to change. ABN AMRO
Bank  N.V.  (including  its  group  companies)  shall not be liable for the
improper  or  incomplete  transmission of the information contained in this
communication  nor  for  any delay in its receipt or damage to your system.
ABN  AMRO  Bank  N.V.  (or its group companies) does not guarantee that the
integrity   of  this  communication  has  been  maintained  nor  that  this
communication is free of viruses, interceptions or interference.
---------------------------------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: database connection pool design

Posted by John McNally <jm...@collab.net>.
If the connection pool is full and no apps are using the pool, I believe
you are correct that the connections will be wasted.  Are you wanting to
free up connections to be used with other applications that are not
getting connections from the pool?  If so, the pool design will not work
for you.  If you are getting all connections throught the pool, I do not
see why it matters how many connections are in the pool waiting to be
used.  Are you trying to minimize overall resource usage?

alexander.vorobiev@abnamro.com wrote:
> 
> Hi
> 
> I'm trying to use Turbine database connection pool in my Tomcat-based
> application. So far it works ok
> but I have several questions regarding the pool design. My main concern is
> connection expiration algorithm.
> As far as I understand from the source code expired/not-expired condition
> is only checked when the connection
> is being returned back to the pool. But that means that if the web
> application has big number of users accessing
> it at some moment, it's going to establish many connections. And if later
> (but before expiration time is up)
> the number of users drops (end of day) then majority of the connections
> won't be closed until somebody
> starts (actively!) using the application again.
> 
> The more desirable behavior would be to have separate thread monitoring
> unused connections periodically
> and closing them upon expiration. Is something like this planned for future
> releases? Or please correct me
> if I'm wrong.
> 
> Another question is why the expiration time starts counting starting from a
> connection creation and not from
> the moment it's returned to the pool. What's wrong with long living
> connections?
> 

I usually set the expiration at around 1 day, but you can probably set
it higher, how long do you want them to live?

john mcnally

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org