commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
Subject Re: torque and my work on its connection pool.
Date Wed, 09 Jan 2002 03:14:13 GMT


On Tue, 8 Jan 2002, John McNally wrote:

> Date: Tue, 08 Jan 2002 17:36:22 -0800
> From: John McNally <jmcnally@collab.net>
> Reply-To: Jakarta Commons Developers List <commons-dev@jakarta.apache.org>
> To: Jakarta Commons Developers List <commons-dev@jakarta.apache.org>
> Subject: Re: torque and my work on its connection pool.
>
>
> > >
> > >   catalina/src/share/org/apache/naming/factory/DbcpDataSourceFactory.java
> > >
> >
> > I would argue that this class belongs with the connection pool.  A jdbc2
> > pool should be ready to deploy within a jndi service provider.
> >
>
>
> A few more points/questions about this object factory.  It seems it
> resets the pool each time the pool is requested from jndi.  My
> understanding is the pool should be setup and deployed into jndi.  Then
> when a class needs a connection it can request the pool from jndi and
> get a connection.  It would seem if this ObjectFactory were used in this
> manner.  The pool would always be starting from scratch.
>

You probably noticed a FIXME comment about this in the source ...

> I guess this factory is used in a different way?
>

In the current Tomcat code, the factory is initially bound to the JNDI
name -- but, the first time it's actually used, the returned data source
is bound in its place.  That way, the pool is created only once, without
the factory itself having to worry about it.

I'm still studying whether that is the actual intent of the J2EE platform
specs w.r.t. object factories -- it may turn out that you're really
supposed to get a new object each time (although you can still do this
around a single "real" connection pool).

> john mcnally
>

Craig


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


Mime
View raw message