Connections not Being Released
Hello,
I'm using C3p0 for connection pooling and using springs jdbc template to handle interaction with the database. Here is how my datasource is configured:
Code:
<bean id="dataSource" destroy-method="close" class="com.mchange.v2.c3p0.ComboPooledDataSource">
<property name="driverClass" value="${jdbc.driverClassName}"></property>
<property name="jdbcUrl" value="${jdbc.url}"></property>
<property name="user" value="${jdbc.username}"></property>
<property name="password" value="${jdbc.password}"></property>
<property name="initialPoolSize" value="3"></property>
<property name="minPoolSize" value="5"></property>
<property name="maxPoolSize" value="50"/>
<property name="maxIdleTime" value="60"/>
<property name="checkoutTimeout" value="100"/>
<property name="maxStatements" value="50"></property>
<property name="automaticTestTable" value="C3P0_TEST_TABLE"></property>
<property name="testConnectionOnCheckin" value="true"></property>
<property name="idleConnectionTestPeriod" value="60"></property>
</bean>
<bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
<property name="dataSource"><ref bean="dataSource"/></property>
</bean>
<bean id="userDAO" class="com.Test.dao.UserDAOImpl">
<property name="jdbcTemplate"><ref bean="jdbcTemplate"/></property>
</bean>
Is there something else I need to do in order to properly close the connections? I'm eventually using up all of the connections in the database and throwing exceptions.
Any help would be greatly appreciated. Tahnk you.