Re: Tomcat/MySql DataSource - Connection Pool does not seem to get initialized
Posted by: Ken Jenkins
Date: January 19, 2005 01:43PM

Tomcat 5.0.24 uses Apache commons-dbcp 1.1 to do its connection pooling. DBCP did not include the property "initialSize" until release 1.2 so that parameter I had in my <ResourceParams> for the JDBC DataSource was getting ignored. So I upgraded my commons-dbcp and its dependencies (commons-pool and commons-collections) and everything worked. DBCP now will create the specified number of initial connections in the pool.

Incidentally, the upgraded commons-dbcp and its dependencies are included with Tomcat starting with 5.0.27.

Also, in a related matter, according to the JDBC 3.0 spec, there is a Driver property named "initialPoolSize", but commons-dbcp does not seem to use the standard property names that are defined by the JDBC 3.0 spec. I guess its because those property names are for JDBC Drivers. DBCP is just a general purpose db connection pooling lib and is not bound by JDBC specs. See section 11.7 for the standard Driver properties defined by JDBC 3.0. I assume those standard property names defined by the JDBC standard are for the case of when a Driver does the connection pooling itself in a two tier environment as opposed to having the application server taking care of the connection pooling in a three tier environment?

Options: ReplyQuote

Written By
Re: Tomcat/MySql DataSource - Connection Pool does not seem to get initialized
January 19, 2005 01:43PM
January 21, 2005 04:00AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.