I am getting "JDBC transaction failed" at first hit to DB. I found one problem is that my MySQL is idle for 10 to 12 hours. So maybe after 10 hours when I am going to hit at login time getting exception.
My configuration is
<bean id="salesOptSessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.MySQL5Dialect</prop>
<prop key="hibernate.format_sql">true</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.hbm2ddl.auto">update</prop>
<prop key="hibernate.jdbc.batch_size">50</prop>
<prop key="hibernate.current_session_context_class">thread</prop>
<prop key="hibernate.connection.isolation">2</prop>
<prop key="hibernate.c3p0.min_size">5</prop>
<prop key="hibernate.c3p0.max_size">20</prop>
<prop key="hibernate.c3p0.timeout">300</prop>
<prop key="hibernate.c3p0.max_statements">50</prop>
<prop key="hibernate.c3p0.idle_test_period">3000</prop>
</props>
</property>
<property name="packagesToScan" value="com.perennialsys.salesoptimization.vo" />
</bean>
How can I solve this?
I found from googling that idle_test_period
should not exceed timeout
. Is this the reason?