Return-Path: Delivered-To: apmail-jakarta-tomcat-dev-archive@jakarta.apache.org Received: (qmail 16085 invoked by uid 500); 2 Oct 2001 03:05:45 -0000 Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: tomcat-dev@jakarta.apache.org Delivered-To: mailing list tomcat-dev@jakarta.apache.org Received: (qmail 16076 invoked from network); 2 Oct 2001 03:05:45 -0000 Message-ID: <3BB9304E.4070400@thestranathans.com> Date: Mon, 01 Oct 2001 22:11:10 -0500 From: Will Stranathan User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.2) Gecko/20010726 Netscape6/6.1 X-Accept-Language: en-us MIME-Version: 1.0 To: tomcat-dev@jakarta.apache.org Subject: Tyrex Pools Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N I started doing a little testing on the Tyrex pools on my local machine, and it doesn't appear to actually be pooling the connections. In a 1 minute period, I managed to get 118 hits (none of the connection lasted for the entire minute - they lasted at most 5 seconds) and I checked my outgoing connections, and had 128 (I'm assuming my stress-tester didn't count 10 connections that were active when I told it to stop.) Anyhow, the point is, every time I request a connection from the pool, I'm getting a brand new connection - not a recycled one. I'm calling close() on the connection in a finally block (and it is getting called). Is there something else I have to do on the DataSource to ensure that the connection gets recycled properly? Or am I missing some configuration in my server.xml? Regards, Will Stranathan Connection conn = null; try { Context ctx = new InitialContext(); DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/Directory"); conn = ds.getConnection(); // etc. } } catch (Exception e) { e.printStackTrace(); } finally { try { conn.close(); System.out.println("closed connection"); } catch (Exception ex) { System.err.println("Error closing connection"); } } user... password... driverClassNameorg.gjt.mm.mysql.Driver driverNamejdbc:mysql://localhost/directory