Help with connection pooling the *right* way...

From: Jeff Kilbride <jeff@xxx.com>
Date: Wed Apr 03 2002 - 13:34:41 PST

I'm using Resin 2.0.5 and MySQL. My current configuration looks like this:

---------------------------
<resource-ref>
  <res-ref-name>jdbc/test</res-ref-name>
  <res-type>javax.sql.DataSource</res-type>
  <init-param driver-name="org.gjt.mm.mysql.Driver"/>
  <init-param url="jdbc:mysql://localhost:3306/test?autoReconnect=true"/>
  <init-param user="XXXX"/>
  <init-param password="XXXX"/>
  <init-param max-connections="20"/>
  <init-param max-idle-time="600"/>
</resource-ref>
---------------------------

I use this resource for form based authentication and everything seems to be
working correctly. I turned on the sql.log and I can see connections being
created, re-used, and then closed when they timeout. Here's my question: is
this the "correct" way to set up a connection pool with Resin and MySQL?
Should I be using some sort of PooledDataSource instead of using the Driver
directly? MySQL comes with both a MysqlPooledConnection class and a
MysqlConnectionPoolDataSource class, but I have no idea if/when/where to use
them.

This is the one aspect of configuration that always confuses me. I have a
feeling my setup is OK, but may not be the best way to do it. Can somebody
please explain this or possibly give an example of their setup?

Thanks,
--jeff
Received on Wed 03 Apr 2002 13:34:41 -0800

This archive was generated by hypermail 2.1.8 : Thu Sep 28 2006 - 20:17:00 PDT