Hello everyone,

I've seen that many people are confused over how to setup pooled connections
in Orion (even I was initially). Now since I figured out through
documentation and through some hit and try, I would like to share these
instructions. Keep in mind that this is only one way of setting it up and
there are other ways to setup depending on capabilities of the driver.

1. Basically, the first step is to create a non-pooled version of your data
source. This can be done by adding something like this to your
data-sources.xml:

        <data-source
                class="com.evermind.sql.DriverManagerDataSource"
                name="SQLServerNP"
                location="jdbc/SQLServerNP"
                xa-location="jdbc/xa/SQLServerXANP"
                ejb-location="jdbc/SQLServerNP"
                connection-driver="com.inet.tds.TdsDriver"
                username="user"
                password="pwd"
                url="jdbc:inetdae:localhost"
                inactivity-timeout="30"
                schema="database-schemas\ms-sql.xml"
        />

The above example is for a SQL Server data source using i-net driver.
Remeber to change the connection-driver, username, password and url.

2. Now, the following step will add the pooled version. Add the following
lines to data-sources.xml.

        <data-source
                class="com.evermind.sql.OrionPooledDataSource"
                name="SQLServer"
                location="jdbc/SQLServerDS"
                xa-location="jdbc/xa/SQLServerXADS"
                ejb-location="jdbc/SQLServerDS"
                max-connections="4"
                source-location="jdbc/SQLServerNP"
                pooled-location="jdbc/SQLServerDS"
                inactivity-timeout="30"
                connection-driver="com.inet.tds.TdsDriver"
                url="jdbc:inetdae:localhost"
        />

Note that the source-location should correspond to location in the 1st step.
"max-connections" can be changed to suit your requirements. I'm not sure
whether url and connection-driver are required here.

The above steps should work for any JDBC drivers. If your driver vendor
supplies a data source, step 1 will be little bit different. Also, some of
the driver vendors directly provide pooled data source implementation in
which case 2 steps are not needed. I could successfully use i-net OPTA
PooledDataSource with Orion.

--Deepak

Reply via email to