On Thu, 7 Nov 2002, Otto Cordero wrote:

> Hi,
> I am using connection pools as described in the examples and documentation
> that comes with the dbcp release, however those examples suggest the use of
> jdbc.drivers property to specify the driver. I don't want to do this since
> my application is web-based, so I changed the code to use a
> DriverConnectionFactory instead of DriverManagerConnectionFactory:
>
> ConnectionFactory connectionFactory
>             = new DriverConnectionFactory(
>                     (Driver)Class.forName(driver).newInstance()
>                     ,connectURI, props);
>
> I would like to know if this is correct and if it should work the same as
> the original code.

Yes, I believe that should work the same.

> I made a servlet using the connection pool and tested it with JMeter. The
> result was that the code that used the pool was always slower than the one
> not using the pool, despite the fact that the graphs provided by JMeter was
> quite different: the one without the pool looks like a logarithm and the one
> with the pool looks like a poisson distribution, both making sense to me.

Application performance will vary according to a number of factors, some
external to the pool configuration itself, but this result seems odd.  If
you're interested in using pooling, or believe it should improve your
performance, feel free to post some of your configuration, database and
test details and I'll see if I can help you out.  I find it hard to
believe that an app that establishes and destroys a new connection on each
request will outperform one that uses the same connection over and over,
which suggests that the pool may be strangely configured or used.

>
> Thanks,
>
> Otto.
>


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

Reply via email to