tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Reynir Hübner <rey...@hugsmidjan.is>
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 : 
http://www-106.ibm.com/developerworks/java/library/j-threads3.html

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!

-reynir@hugsmidjan.is





--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message