| Author |
DataSource getConnection() configuring new connection timeout
|
Allan Brockenbrough
Greenhorn
Joined: Nov 07, 2008
Posts: 1
|
|
I'm having a problem configuring the timeout that is used when establishing a new connection to an Oracle database when using a connection pool. I'm using DBCP in Tomcat and XML to configure the resource (below). I'm using the oracle thin jdbc. In the source code I get a DataSource and connection like this: DataSource ds = (DataSource) envCtx.lookup("jdbc/anncDB"); Connection conn = ds.getConnection(); This works fine if the IP specified in the url is available. But if it is not available, it takes 3 minutes before getConnection() returns. I need to configure this to be smaller. I've tried setLoginTimeout(), but that doesn't work. Doing ds.setLoginTimeout() takes 3 minutes before failing. Any ideas? Allan ------- <Context path="/aeservlet"> <Logger className="org.apache.catalina.logger.FileLogger" prefix="aeservlet." suffix=".log" timestamp="true"/> <Resource name="jdbc/anncDB" auth="Container" type="javax.sql.DataSource" maxActive="10" maxIdle="1" maxWait="5000" username="xxxx" password="xxxx" driverClassName="oracle.jdbc.driver.OracleDriver" url="jdbc racle:thin:@10.0.0.0:1521:ODS" factory="org.apache.commons.dbcp.BasicDataSourceFactory" connectionProperties="" removeAbandoned="1" removeAbandonedTimeout="1" description="Resource in server.xml GlobalNamingResources"/> </Context> Oracle driver version: v10.2.0
|
 |
 |
|
|
subject: DataSource getConnection() configuring new connection timeout
|
|
|