Hi Ryan, Thanks for the solution. I believe it's resolved my problem.
Rudi -----Original Message----- From: Ryan Lissack [mailto:[EMAIL PROTECTED] Sent: 03 March, 2004 10:15 AM To: 'Tomcat Users List' Subject: RE: OracleConnectionPoolDataSource creates too many connections Hi, You still need to create a connection cache with that datasource, so something like : OracleConnectionPoolDataSource ocpds = new OracleConnectionPoolDataSource(); ... OracleConnectionCache oracleConnectionCache = new OracleConnectionCacheImpl(ocpds); You can then call the following to get connections from the pool : oracleConnectionCache.getConnection(); Be sure to close all your connection when you are done so they are returned to the pool. Ryan. -----Original Message----- From: Rudi Doku [mailto:[EMAIL PROTECTED] Sent: 03 March 2004 09:04 To: Tomcat Users List Subject: OracleConnectionPoolDataSource creates too many connections Importance: High Hi All, My web application is using up all connections after running for a while. It's quite obvious that I'm not using the connection pool as it was designed to be used. The only way I can get these connections back is by restarting the Tomcat. I have ojdbc14.jar in the following directories: $CATALINA_HOME/commons/lib directory & $CATALINA_HOME/webapps/<myWebApp>/WEB-INF/lib. This code creates my connection Pool ------------------------------------ private void createConnectionPool( ) { try { // Create a OracleConnectionPoolDataSource instance. connectionPoolDS = new OracleConnectionPoolDataSource( ); String url = "jdbc:oracle:thin:@194.26.151.17:1521:mosaic"; connectionPoolDS.setURL( url ); // Set the user name. connectionPoolDS.setUser("mosaicuser"); // Set the password. connectionPoolDS.setPassword("mosa1c"); } catch ( SQLException ex ) { // Catch SQL errors. //context.log( ex.toString( ) ); // log errors. } } This code creates a PooledConnection. ------------------------------------- public static synchronized PooledConnection getPooledConnection(){ try{ pooledconn = connectionPoolDS.getPooledConnection(); }catch(SQLException sqle){ sqle.printStackTrace(); } return pooledconn; } In my LoginServlet, I create a new PooledConnection, which I add to the Servlet Context: PooledConnection pc = ConnectionFactory.getInstance.getPooledConnection(); ServletContext ctx = getServletContext(); ctx.setAttribute("pooled_conn", pc); On an JSP Page: ServletContext ctx = getServletContext(); PooledConnection pc = (PooledConnection)ctx.getAttribute("pooled_conn"); Connection con = pc.getConnection //do a few things with the connection try{ if (con != null){ con.close(); } // I'm assumingthis returns the connection to the Pool }catch(SQLException sqle){ sqle.printStackTrace(); } Any help to solve this mystery would be very much appreciated. Kind Regards, Rudi --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]