Anonymous | Login | Signup for a new account | 12-17-2024 11:42 PST |
Main | My View | View Issues | Change Log | Docs |
Viewing Issue Simple Details [ Jump to Notes ] | [ View Advanced ] [ 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 | ||||||
Status | closed | Product Version | 3.1.8 | ||||||
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(); } } |
||||||||
Additional Information | |||||||||
Attached Files | |||||||||
|
Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
29 total queries executed. 26 unique queries executed. |