Can't Make Connection Pooling Wotk
I've been beating my head against the wall form two days now trying to get connection pooling to work. I'm using Spring 3 & Hibernate 4. Here's the basic setup:
Code:
<bean id='sharedPoolingProperties' class='com.jolbox.bonecp.BoneCPDataSource'
destroy-method="close" abstract='true'>
<property name="idleMaxAgeInSeconds" value="60"/>
< ... >
</bean>
<bean id='dataSource' parent='sharedPoolingProperties'>
<property name="driverClass" value="com.mysql.jdbc.Driver" />
<property name="jdbcUrl" value="..." />
<property name='username' value='...' />
<property name='password' value='...' />
</bean>
<bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="configLocation" value='classpath:hibernate.cfg.xml' />
<property name='entityInterceptor'>
<bean class='org.tabbysplace.checkout.hibernate.entityInterceptor' />
</property>
<property name="hibernateProperties">
. . .
</property>
</bean>
I have a two minute connection timeout on my test DB. But after my first successful DB connection, all further attempts fail saying the familiar
ERROR: org.hibernate.engine.jdbc.spi.SqlExceptionHelper - Communications link failure
The last packet successfully received from the server was 273,875 m...
I also tried with c3p0, but the same thing occurs.
I must be doing something fundamentally wrong, but I don't know what.
Any help appreciated.