tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Reynir Hübner <>
Subject JDBC / ThreadLocal pattern.
Date Wed, 30 Oct 2002 19:06:14 GMT
Hi all, 

This email is a little bit off topic, as it's more about JDBC-related stuff than tomcat.

I'm really looking for comments on the approach for JDBC connection pooling described in the
article at :

In (very) short:  the idea here is to have one jdbc-connection for each thread, instead of
a pool with connections.

I've got few ideas on the subject, for example this may be cool because : 

 1. I will never have to worrie about not returning connections anymore, as they will always
be garbage collected as soon as the thread is dead.
 2. The connection will be available for more than one request so I can lazy load resultsets.
 3. This might make transaction-service implementation easyer
 4. many other great things....

I realise there must be some kind of problems by doing it this way, but I only came up with
these :

 1. can this approach cause too many connections to the database (75 threads in Tomcat is
the default means 75 connections) ?
 2. can it be to heavy for the garbagecollector to collect all the dead connections lying
around when a thread dies ?
 3. anything more negative stuff ?

I am looking for comments on the pattern.. Please respons if you have any.
Thanx alot!

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message