Mantis - Resin
|
|||||
Viewing Issue Advanced Details | |||||
|
|||||
ID: | Category: | Severity: | Reproducibility: | Date Submitted: | Last Update: |
3318 | major | always | 02-04-09 15:05 | 05-07-09 09:40 | |
|
|||||
Reporter: | atifmk | Platform: | |||
Assigned To: | ferg | OS: | |||
Priority: | urgent | OS Version: | |||
Status: | closed | Product Version: | 3.1.8 | ||
Product Build: | Resolution: | fixed | |||
Projection: | none | ||||
ETA: | none | Fixed in Version: | 4.0.1 | ||
|
|||||
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: | |||||
Relationships | |||||
Attached Files: |
Notes | |||||
|
|||||
|
|