You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Mathew Clark <ma...@genicomsystems.com> on 2001/05/28 17:37:34 UTC

JDBC Connections

Hi,

We have implemented a simple JDBC connection pool for our servlet - do you
think it is better to grab a connection once when a request is received and
use that connection throughout the processing or should the connection be
used only when necessary and released as soon as possible??

Regards,

Matthew.


RE: JDBC Connections

Posted by Paulo J S Pereira <pa...@sentex.net>.
Mathew,

It's been my experience to only use it when necessary and release it back to
the pool when done. Otherwise, it is redundant to have a pool to being with.
The pool's power comes in its management of "available" connections, if you
minimize the available connections, the pool will try to grow and eventually
lose it's effectiveness. You will also experience a performance hit for it.

Persistance layer implementaions rely on that principal in managing its
connection pool.

Paulo Pereira
Java/Web Developer
Sentricity Inc.,
A Division of Sentex Communications Corp.,
www.sentricity.com

-----Original Message-----
From: Mathew Clark [mailto:matt@genicomsystems.com]
Sent: Monday, May 28, 2001 11:38 AM
To: tomcat-user@jakarta.apache.org
Subject: JDBC Connections


Hi,

We have implemented a simple JDBC connection pool for our servlet - do you
think it is better to grab a connection once when a request is received and
use that connection throughout the processing or should the connection be
used only when necessary and released as soon as possible??

Regards,

Matthew.