Kavin's SOA Blog

June 7, 2009

FTP Adapter connection Pooling

In order to setup connection pooling on a connection factory with “none” connection pool we will need to modify oc4j-ra.xml of the FTP adapter. We need to make sure that “keepConnections” parameter is set to true

<config-property name="keepConnections" value="true"/>

and we need to create connection-pool settings. Please note that you might find an empty node like

<connection-pooling use="none">
        </connection-pooling>

and you need to replace it with

<connection-pooling use="private"> 
            <property name="waitTimeout" value="300" />
            <property name="scheme" value="fixed_wait" />
            <property name="maxConnections" value="50" />
            <property name="inactivity-timeout-check" value="all" />
            <property name="minConnections" value="5" />
            <property name="inactivity-timeout" value="50" />
</connection-pooling>

Or create a shared connection pool say “ftpPool” as shown below

<connection-pool name="ftpPool">
      <property name="waitTimeout" value="300" />
       <property name="scheme" value="fixed_wait" />
       <property name="maxConnections" value="50" />
       <property name="inactivity-timeout-check" value="all" />
       <property name="minConnections" value="5" />
       <property name="inactivity-timeout" value="50" />
</connection-pool>

and then modify connection-pooling section as

<connection-pooling use="shared">
      <use-connection-pool>ftpPool</use-connection-pool>
</connection-pooling>’

It’s a good practice to configure connection pool while configuring connection factory for the first time. At that time it asks whether to use “private” or “shared” or “none” connection pool. If you make this selection during that time, you won’t be required to modify configuration files manually (which I discourage most).

Blog at WordPress.com.