Summary: | tomcat jdbc pool stackoverflow error used with spring | ||
---|---|---|---|
Product: | Tomcat Modules | Reporter: | yanky <yanky.young> |
Component: | jdbc-pool | Assignee: | Tomcat Developers Mailing List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | P2 | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | All |
Description
yanky
2012-12-03 11:29:47 UTC
1. The call to ConnectionPool.borrowConnection( ) is caused by setting <property name="initialSize" value="5"/> which causes ConnectionPool.init() to create 5 connections. 2. The call to PooledConnection.connectUsingDataSource() is seriously wrong. It should have called PooledConnection.connectUsingDriver() instead. This can happen only if poolProperties.getDataSource() is not null. I do not see how this could have happened. Did Spring injected a recursive reference by calling DataSource.setDataSource()? 3. When you define the pool via <Resource>, it is created using org.apache.tomcat.jdbc.pool.DataSourceFactory. The factory calls dataSource.createPool(). So it might be better to add init-method="createPool". Do you have autowire in Spring enabled? If so, it'll inject a 'dataSource'-object in the setDataSource-property of your DataSource-instance... Its a bit weird that the object has a setDataSource-method at all, but you can fairly easily fix it by setting autowire="no" on the particular pool, like so: <bean id="dataSource" class="org.apache.tomcat.jdbc.pool.DataSource" destroy-method="close" autowire="no"> |