You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cayenne.apache.org by Marie Goutière <sw...@hotmail.com> on 2006/04/04 16:54:25 UTC

OracleDataSourceFactory

Hello everybody.

Is it possible to make an OracleDataSourceFactory with Tomcat (in the tomcat 
web.xml /ressourceParam tag) works with Cayenne or not.

We're trying to open an other connection to an Oracle database but it 
doesn't work.
It seems that tomcat doesn't "take care" of this OracleDataSourceFactory.

Is anyone has ever tried this ?

Thanks
Marie



Re: OracleDataSourceFactory

Posted by Andrus Adamchik <an...@objectstyle.org>.
On Cayenne end you need to specify JNDIDataSourceFactory and use the  
JNDI name mapped in Tomcat.

I don't have experience with OracleDataSourceFactory pool per se, but  
you don't have to use it - AFAIK Tomcat wraps the driver in its own  
pool.

Watch out for two things:

1. Oracle driver jar must be in $tomcat_home/common/lib

2. server.xml entry depends on Tomcat version. Here is examples of my  
existing configurations (note that there is no factory specification  
anywhere, just the driver)

*** Tomcat 5.5

<Context path="/myapp" docBase="myapp">
   <Resource name="jdbc/myds" auth="Container"
           type="javax.sql.DataSource"  
driverClassName="oracle.jdbc.driver.OracleDriver"
           url="jdbc:oracle:thin:@127.0.0.1:1521:dbname"
           username="userName" password="secret" maxActive="5"  
maxIdle="2"
	maxWait="-1"/>
</Context>

*** Tomcat 5.0

<Resource name="jdbc/myds" auth="Container"  
type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/myds">
     <parameter>
        <name>username</name>
         <value>***</value>
      </parameter>
      <parameter>
       <name>password</name>
       <value>****</value>
       </parameter>
      <parameter>
         <name>driverClassName</name>
         <value>oracle.jdbc.driver.OracleDriver</value>
      </parameter>
      <parameter>
        <name>url</name>
        <value>jdbc:oracle:thin:@127.0.0.1:1521:dbname</value>
        </parameter>
<parameter>
     <name>maxActive</name>
     <value>20</value>
   </parameter>
   <parameter>
     <name>maxIdle</name>
     <value>10</value>
   </parameter>

</ResourceParams>

Andrus


On Apr 4, 2006, at 6:54 PM, Marie Goutière wrote:

> Hello everybody.
>
> Is it possible to make an OracleDataSourceFactory with Tomcat (in  
> the tomcat web.xml /ressourceParam tag) works with Cayenne or not.
>
> We're trying to open an other connection to an Oracle database but  
> it doesn't work.
> It seems that tomcat doesn't "take care" of this  
> OracleDataSourceFactory.
>
> Is anyone has ever tried this ?
>
> Thanks
> Marie
>
>
>