Mantis Bugtracker
  

Viewing Issue Advanced Details Jump to Notes ] View Simple ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0003318 [Resin] major always 02-04-09 15:05 05-07-09 09:40
Reporter atifmk View Status public  
Assigned To ferg
Priority urgent Resolution fixed Platform
Status closed   OS
Projection none   OS Version
ETA none Fixed in Version 4.0.1 Product Version 3.1.8
  Product Build
Summary 0003318: Database connection pooling with Oracle RAC
Description The example given on wiki @ http://wiki.caucho.com/Oracle_RAC [^] is wrong. The oracle driver would now work with fast connection failover and caching enabled with OracleConnectionPoolDataSource. Oracle recommends using OracleDataSource instead.

The problem is that when the OracleDataSource is defined as the driver type in database configuration, Resin is not able to configure the connection pool and throws error. The exact error is:

com.caucho.sql.DriverConfig.setType(): 'oracle.jdbc.pool.OracleDataSource' is not a valid database type.

Here is the configuration in resin.conf:

    <database>
      <jndi-name>jdbc/oracle</jndi-name>
      <driver>
        <type>oracle.jdbc.pool.OracleDataSource</type>
        <url>jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=host.com)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=hostdb)))</url>
        <user>user</user>
        <password>pass</password>
        <connection-caching-enabled>true</connection-caching-enabled>
        <fast-connection-failover-enabled>true</fast-connection-failover-enabled>
        <ons-configuration>nodes=host.com:1521</ons-configuration>
      </driver>
      <prepared-statement-cache-size>8</prepared-statement-cache-size>
      <max-connections>10</max-connections>
      <max-idle-time>30s</max-idle-time>
    </database>

The same exact configuration works in standalone Java program.

import java.sql.Connection;
import java.sql.ResultSet;

import oracle.jdbc.pool.OracleDataSource;

public class OracleRACTest {

    /**
     * @param args
     * @throws Throwable
     */
    public static void main(String[] args) throws Throwable {
        OracleDataSource ds = new OracleDataSource();
        ds.setURL("jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=host.com)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=hostdb)))");
        ds.setUser("user");
        ds.setPassword("pass");
        ds.setConnectionCachingEnabled(true);
        ds.setFastConnectionFailoverEnabled(true);
        ds.setONSConfiguration("nodes=host.com:1521");
        
        Connection conn = ds.getConnection();
        ResultSet rs = conn.createStatement().executeQuery("select count(*) from test");
        rs.next();
        System.out.println("Count#: " + rs.getInt(1));
        
        conn.close();
    }
}
Steps To Reproduce
Additional Information
Attached Files

- Relationships

- Notes
(0003987)
ferg
05-07-09 09:40

server/4508
 

- Issue History
Date Modified Username Field Change
02-04-09 15:05 atifmk New Issue
02-09-09 09:33 ferg Priority normal => urgent
05-07-09 09:40 ferg Note Added: 0003987
05-07-09 09:40 ferg Assigned To  => ferg
05-07-09 09:40 ferg Status new => closed
05-07-09 09:40 ferg Resolution open => fixed
05-07-09 09:40 ferg Fixed in Version  => 4.0.1


Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
29 total queries executed.
26 unique queries executed.
Powered by Mantis Bugtracker