Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

connection pooling - configuraton with spring

649904Jul 14 2008 — edited Jan 20 2015
Hi,

I am trying to configure connection pooling with spring for a standalone java program.

My configuration looks like this:

<bean id="dataSource" class="oracle.jdbc.pool.OracleDataSource">
<property name="URL"
value="jdbc:oracle:thin:@{IP}:1521:myName" />
<property name="user" value="{user}" />
<property name="password" value="{pass}" />
<property name="connectionCachingEnabled" value="true" />
<property name="connectionCacheName"
value="my_connection_pool" />
<property name="connectionCacheProperties">
<props >
<prop key="minLimit">5</prop>
<prop key="maxLimit">5</prop>
<prop key="inactivityTimeout">30</prop>
</props>
</property>

If I use connectionCachingEnabled then the connection is waiting for further calls, if I omit it then after every statement the connection is closed. So this property seems to be used.

But connectionCacheProperties isn't used at all. (I found this example somewhere in the web so it might be completely wrong.)

How can I set such properties like minimum and maximum number of connections, inactivityTimeout and also a checker whether the connection is still alive and possible restart it (currently the application crashes if the tcp connection got lost, e.g. because the oracle machine was rebooted.)

I tried also OracleConnectionPoolDataSource instead of OracleDataSource but didn't notice any differences.

TIA,
Eddie
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 25 2008
Added on Jul 14 2008
1 comment
3,579 views