geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Piers Geyman <piers.gey...@gta-travel.com>
Subject Re: How to configure a datasource to use OracleDataSource for Datasource pooling
Date Thu, 14 Jun 2007 16:03:40 GMT

Hi David,

More background info:
I can connect to RAC successfully using the oracle tranQL Resource Adapter,
but this method does not allow the ability to use the more powerful features
of the RAC environment, namely Fast Connection Failover (FCF). With FCF the
Oracle Datasource Connection pool (oracle.jdbc.pool.OracleDataSourceFactory)
is used to obtain and manage DataSources. The OracleDataSourceFactory uses
the Oracle Notification Service (ONS) to subscribe to RAC notification
events to help it manage its pool of connections. When a RAC node goes down
the RAC will send a notification via ONS to any subscribers to let them know
that the Node is no longer available. The OracleDataSourceFactory will
receive this event and then remove any of the connections to that Node in
its pool instantly, so that any new connections requested will be valid.
This means that the application will get valid connections if a node goes
down, rather than getting connections that are invalid and having handle the
event - hence Fast Connection Failover.

The following document describes most of this:
http://www.oracle.com/technology/products/database/clustering/pdf/twpracwkldmgmt.pdf

We have some projects that do not use JTA, do you have any examples of how
to create this gbean?
Newer projects we are working on do require jta though, so a "proper"
solution would be better.



Regards

Piers


djencks wrote:
> 
> 
> On Jun 14, 2007, at 7:29 AM, Piers Geyman wrote:
> 
>>
>> Hi,
>>
>> I can get a connection running to Oracle just using the tranql  
>> connector
>> that uses the tranQL/geronimo connection pooling, but I need to use  
>> the
>> Oracle Connection Pooling as I am using Oracle RAC and oracle needs to
>> manage the connections in the pool based on information it receives  
>> from the
>> Oracle RAC.
>>
>> Do I need to develop my own Resource Adapter to be able to have  
>> database
>> connection served by the Oracle Connection Factory Pool
>> (oracle.jdbc.pool.OracleDataSourceFactory), or am I missing some  
>> obvious
>> configuration of geronimo/tranQL that would allow me to specify the  
>> Oracle
>> class (oracle.jdbc.pool.OracleDataSourceFactory) as my connection  
>> pool?
>>
> 
> At the moment there's no way to have oracle manage a connection pool,  
> and it doesn't fit into the idea of the connector architecture.  I  
> looked for some RAC documentation and it looks like there's a way for  
> weblogic to do the pooling at least for oracle 10g  
> (bestpracticesforxaandrac.pdf, p.6).  That makes me suspect that  
> there is some way to use RAC through a resource adapter.  For  
> instance, does oracle supply an XADataSource?
> 
> Do you know what the oracle connection pooling does?  Why is this  
> something that would be difficult for the connection manager to do?
> 
> If there's really no way to avoid Oracle managing the connections it  
> should still be fairly easy to write a modified ConnectionManager  
> that doesn't do pooling but delegates to oracle.  If you don't need  
> jta transactions at all there's probably an even simpler way to do  
> this by writing a gbean that creates the datasource, and has a method  
> called $getResource that returns it.  If you then name this gbean  
> correctly it should fit into our jndi lookup mechanism.
> 
> Is there publicly available documentation on how to use RAC in a java  
> enterprise environment, e.g. javadoc or some indication of what  
> classes are available and for what purposes?
> 
> thanks
> david jencks
> 
>> Thanks and regards
>>
>> Piers
>>
>>
>>
>> Lin Sun-2 wrote:
>>>
>>> Hi, I tried this with Geronimo 1.1 w/ daytrader.  Basically I need to
>>> copy the oracle tranql rar file and the oracle jar file into my
>>> repository, and specify the dependency of the oracle jar file  
>>> somewhere
>>> in the plan -
>>>
>>>
>>>        <dep:dependency>
>>>          <dep:groupId>oracle</dep:groupId>
>>>          <dep:artifactId>classes12</dep:artifactId>
>>>          <dep:version>10g</dep:version>
>>>          <dep:type>jar</dep:type>
>>>        </dep:dependency>
>>>
>>>
>>> and develop a resource adapter plan like below  (below is an  
>>> application
>>> scoped connection pool plan, but it can also be a server wide plan).
>>>
>>>    <ext-module>
>>>      <connector>TradeDataSource</connector>
>>>
>>> <external-path>tranql/tranql-connector-oracle-xa/1.1/rar</external-

>>> path>
>>>      <connector
>>> xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-1.1">
>>>        <resourceadapter>
>>>          <outbound-resourceadapter>
>>>            <connection-definition>
>>>
>>> <connectionfactory-interface>javax.sql.DataSource</ 
>>> connectionfactory-interface>
>>>              <connectiondefinition-instance>
>>>                <name>jdbc/TradeDataSource</name>
>>>                <config-property-setting
>>> name="UserName">trade</config-property-setting>
>>>                <config-property-setting
>>> name="Password">trade</config-property-setting>
>>>                <config-property-setting
>>> name="DatabaseName">tradedb</config-property-setting>
>>>                <config-property-setting
>>> name="DataSourceName">TradeDataSource</config-property-setting>
>>>                <config-property-setting
>>> name="ServerName">linsun2</config-property-setting>
>>>                <config-property-setting
>>> name="PortNumber">1521</config-property-setting>
>>>                <config-property-setting
>>> name="DriverType">thin</config-property-setting>
>>>                <connectionmanager>
>>>                  <xa-transaction>
>>>                    <transaction-caching/>
>>>                  </xa-transaction>
>>>                  <single-pool>
>>>                    <max-size>10</max-size>
>>>                    <min-size>0</min-size>
>>>
>>> <blocking-timeout-milliseconds>5000</blocking-timeout-milliseconds>
>>>                    <idle-timeout-minutes>30</idle-timeout-minutes>
>>>                    <match-one/>
>>>                  </single-pool>
>>>                </connectionmanager>
>>>              </connectiondefinition-instance>
>>>            </connection-definition>
>>>          </outbound-resourceadapter>
>>>        </resourceadapter>
>>>      </connector>
>>>    </ext-module>
>>>
>>> The oracle tranql rar file isn't in the geronimo assembly,
>>> unfortunatelly.  So you'll have to get it from the Tranql project
>>> (http://tranql.codehaus.org/Download).  You can download the binary
>>> (that is a bit old than what I used) or build it yourself.  The  
>>> ra.xml
>>> inside of the rar file contains what configuration parameters you can
>>> specify in the connection pool plan.
>>>
>>> HTH, Lin
>>>
>>> Piers Geyman wrote:
>>>> Hi,
>>>>
>>>> I am trying to migrate from tomcat to geronimo and I am having  
>>>> trouble
>>>> being
>>>> able to configure my Oracle RAC datasource in geronimo to use the  
>>>> Oracle
>>>> Driver's connection pooling rather than the default geonimo pooling.
>>>>
>>>> In tomcat I configured my datasource as follows, which used the  
>>>> Oracle
>>>> Datasource connection pool rather than DBCP, but I cannot see how  
>>>> I can
>>>> do
>>>> the same in Geronimo.
>>>>
>>>>
>>>>         <Resource
>>>>                 auth="Container"
>>>>                 description="My Oracle Datasource"
>>>>                 name="jdbc/myOracleDataSource"
>>>>                 type="oracle.jdbc.pool.OracleDataSource"
>>>>                 factory="oracle.jdbc.pool.OracleDataSourceFactory"
>>>>                 driverClassName="oracle.jdbc.OracleDriver"
>>>> 			
>>>> url="jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP) 
>>>> (HOST=oraclehost1)(PORT=1529))(ADDRESS=(PROTOCOL=TCP) 
>>>> (HOST=oraclehost2)(PORT=1529))(LOAD_BALANCE=yes)(CONNECT_DATA= 
>>>> (SERVER=DEDICATED)(SERVICE_NAME=TESTDB)))"
>>>>                 user="devapp"
>>>>                 password="devapp"
>>>>                 maxIdle="20"
>>>>                 minIdle="10"
>>>>                 maxWait="5000"
>>>>                 maxActive="100"
>>>>                 connectionCachingEnabled="true"
>>>>                 fastConnectionFailoverEnabled="true"
>>>>                 connectionCacheName="myOracleDatasourceCache"
>>>>                  
>>>> onsConfigStr="nodes=oraclehost1:6200,oraclehost2:6200"
>>>>                  
>>>> connectionProperties="oracle.jdbc.ReadTimeout=30000"/>
>>>>
>>>>
>>>>
>>>> I see that other connection pools to the databases seem to use  
>>>> tranQL,
>>>> but
>>>> there seems to be no documentation for this product.
>>>>
>>>> Any help would be appreciated.
>>>>
>>>> Thanks and regards
>>>>
>>>> Piers
>>>
>>>
>>>
>>
>> -- 
>> View this message in context: http://www.nabble.com/How-to- 
>> configure-a-datasource-to-use-OracleDataSource-for-Datasource- 
>> pooling-tf3921766s134.html#a11121302
>> Sent from the Apache Geronimo - Users mailing list archive at  
>> Nabble.com.
>>
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-configure-a-datasource-to-use-OracleDataSource-for-Datasource-pooling-tf3921766s134.html#a11123189
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Mime
View raw message