Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 40930 invoked from network); 12 Mar 2006 20:31:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 12 Mar 2006 20:31:47 -0000 Received: (qmail 38813 invoked by uid 500); 12 Mar 2006 20:31:43 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 38794 invoked by uid 500); 12 Mar 2006 20:31:43 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Jakarta Commons Users List" Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 38782 invoked by uid 99); 12 Mar 2006 20:31:43 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 12 Mar 2006 12:31:43 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of vijay.anjur@gmail.com designates 64.233.162.196 as permitted sender) Received: from [64.233.162.196] (HELO zproxy.gmail.com) (64.233.162.196) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 12 Mar 2006 12:31:42 -0800 Received: by zproxy.gmail.com with SMTP id z31so1063575nzd for ; Sun, 12 Mar 2006 12:31:19 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=QslXxsTBN2Zo1zYxKzkWgUO//1BuJpGAVUqCnKOLWTLEj+FyxujRwPOvaabouNYBVhdI2AjmG3UmgA0c0IfACBLTDbh6+AaliZ3KGvi1azUH9nxr++T6diBgI6ILMbhBpKi4p0I8PBkWuHyGEHEeSPyEEl43YfU+UtTNklEOwtw= Received: by 10.37.2.70 with SMTP id e70mr2514492nzi; Sun, 12 Mar 2006 12:31:19 -0800 (PST) Received: by 10.36.22.8 with HTTP; Sun, 12 Mar 2006 12:31:19 -0800 (PST) Message-ID: <83247d4c0603121231o66f99a8cj609911498c5705f2@mail.gmail.com> Date: Sun, 12 Mar 2006 15:31:19 -0500 From: "Vijay Anjur" To: commons-user@jakarta.apache.org Subject: Fwd: DBCP Connection pooling with JTDS Driver. In-Reply-To: <83247d4c0603121224u736f9663y182928a1c9f0f73@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_12320_7555848.1142195479598" References: <83247d4c0603121224u736f9663y182928a1c9f0f73@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------=_Part_12320_7555848.1142195479598 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi, I am having trouble with dbcp connection pooling with JTDS driver. When I close the connection, pool never seem to shrink after the idle time specified in server.xml has passed. When I check using GetNumIdle() method, it always shows zero, even after th= e connections are closed.Any Ideas? Here is my server config & the code. Code snippet: private InitialContext ic =3D null; private Context envCtx =3D null; private static DataSource dsINTLDB; private static GenericObjectPool poolINTLDB; private static PoolingDataSource pdsINTLDB; private static BasicDataSource bdsINTLDB; ic =3D new InitialContext(); envCtx =3D (Context) ic.lookup("java:comp/env"); dsINTLDB =3D (DataSource) envCtx.lookup("ds/somedb"); if (dsINTLDB !=3D null) { bdsINTLDB =3D (BasicDataSource)dsINTLDB; ConnectionFactory cf1 =3D new DataSourceConnectionFactory(dsINTLDB); poolINTLDB =3D new GenericObjectPool(null, bdsINTLDB.getMaxActive(), (byte)1, bdsINTLDB.getMaxWait(), bdsINTLDB.getMaxIdle(), bdsINTLDB.getMinIdle(), bdsINTLDB.getTestOnBorrow(), bdsINTLDB.getTestOnReturn(), bdsINTLDB.getTimeBetweenEvictionRunsMillis(), bdsINTLDB.getNumTestsPerEvictionRun(), bdsINTLDB.getMinEvictableIdleTimeMillis(), bdsINTLDB.getTestWhileIdle() ); PoolableConnectionFactory pcf1 =3D new PoolableConnectionFactory(cf1, poolINTLDB, null, null, false, true); pcf1.setValidationQuery(bdsINTLDB.getValidationQuery()); pdsINTLDB =3D new PoolingDataSource(poolINTLDB); } Connection c =3D pdsINTLDB.getConnection(); //use connection. c.close(); =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D ------=_Part_12320_7555848.1142195479598--