I see that after 1 hour of running, Oracle Connection Pool throws exceptions
” SQLException Ocurred:Invalid or Stale Connection found in the Connection Cache”
Here is the properties file:
<bean id="datasource" class="oracle.jdbc.pool.OracleDataSource" destroy-method="close">
<property name="URL" value="${local.url}" />
<property name="user" value="${local.username}" />
<property name="password" value="${local.password}" />
<property name="connectionProperties">
<props>
<prop key="includeSynonyms">true</prop>
</props>
</property>
<property name="connectionCachingEnabled" value="true"/>
<property name="connectionCacheProperties">
<props>
<prop key="PropertyCheckInterval">60</prop> <!-- 1 min -->
<prop key="ValidateConnection">true</prop>
<prop key="MinLimit">2</prop>
<prop key="MaxLimit">25</prop>
<prop key="InitialLimit">2</prop>
<prop key="ConnectionWaitTimeout">60</prop> <!-- 1 min -->
<prop key="InactivityTimeout">1800</prop> <!-- 30 mins -->
<prop key="AbandonedConnectionTimeout">600</prop> <!-- 10 mins -->
</props>
</property>
</bean>
Can somebody tell me why this is failing after 1 hour, even though the transactions are active.
I was not using multi-threading and it was failing. Also, we need to configure the num of threads to atleast the min number of connections. Otherwise the connections become stale and throw exceptions