Hello,

I'm certainly not an expert on this area and I can only answer from my
experience. If you're not using a pooled connection, a connection is opened
for each request in CMP. If you're using BMP, it's totally upto you to
control connection handling. Even with BMP, it is advised that a datasource
defined within the container be used so that the container (Orion) can
manage connection pooling etc.

In case of CMP and a pooled datasource, the connection sharing across beans
is dependent on how you specify the datasource in orion-ejb-jar.xml. Say for
both beans A and B, you specify jdbc/SQLServerDS as the datasource, then
Orion will only use connections available from the pool of connections for
jdbc/SQLServerDS.

I request the Orion team to correct me if any of this is not correct.

--Deepak

-----Original Message-----
From: Rick Bos [mailto:[EMAIL PROTECTED]]
Sent: Saturday, October 07, 2000 5:38 AM
To: Orion-Interest
Subject: RE: ANSWER: How to use pooled connections in Orion?


I have a question.

If I only specify a location, not a pooled location, does Orion
not do any connection pooling ?

For example, if I have several container managed entity beans from
the same database, would Orion share the same connection for these ?

Thanks.

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Goel, Deepak
Sent: Saturday, October 07, 2000 12:09 AM
To: Orion-Interest
Subject: ANSWER: How to use pooled connections in Orion?


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