Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 95229 invoked from network); 1 Jul 2005 22:19:31 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 1 Jul 2005 22:19:31 -0000 Received: (qmail 1448 invoked by uid 500); 1 Jul 2005 22:19:24 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 1369 invoked by uid 500); 1 Jul 2005 22:19:24 -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 1352 invoked by uid 99); 1 Jul 2005 22:19:23 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Jul 2005 15:19:23 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: 66.150.58.18 is neither permitted nor denied by domain of thomas.fischer@movielink.com) Received: from [66.150.58.18] (HELO mxpostfix01.trusecureonline.com) (66.150.58.18) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Jul 2005 15:19:25 -0700 Received: from mxmta01 (unknown [10.15.1.5]) by mxpostfix01.trusecureonline.com (Postfix) with SMTP id E528FC8F6 for ; Fri, 1 Jul 2005 22:19:19 +0000 (UTC) Received: from oberon.digitaldist.net [4.38.41.231] (HELO oberon.digitaldist.net) by mxmta01 (mxl_mta-1.3.8-10) with SMTP id 761c5c24.1293.001.mxmta01; Fri, 01 Jul 2005 22:19:19 +0000 (UTC) Received: from mimas.digitaldist.net ([192.168.1.25]) by oberon.digitaldist.net with Microsoft SMTPSVC(5.0.2195.6713); Fri, 1 Jul 2005 15:19:12 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C57E8A.E8F4F0D4" Subject: [dbcp] ValidationQuery doesn't seem to be executed Date: Fri, 1 Jul 2005 15:19:11 -0700 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [dbcp] ValidationQuery doesn't seem to be executed Thread-Index: AcV+iuhAqgL5JpwTSva033S/mk9i7w== From: "Thomas Fischer" To: X-OriginalArrivalTime: 01 Jul 2005 22:19:12.0526 (UTC) FILETIME=[E8BDB2E0:01C57E8A] X-MX-Spam: exempt X-MX-MAIL-FROM: X-MX-SOURCE-IP: [4.38.41.231] X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------_=_NextPart_001_01C57E8A.E8F4F0D4 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi, I had some suspicions, if dbcp is executing the validation query. So, I created an Oracle sequence, and had the validation query increment it. The sequence is not getting incremented. It's probably a configuration mistake on my part. Please, take a look at my code: // set up dbcp BasicDataSource ds =3D new BasicDataSource(); ds.setDriverClassName("oracle.jdbc.driver.OracleDriver"); ds.setUsername("bla"); ds.setPassword("bla"); ds.setUrl("jdbc:oracle:thin:@bla:1521:bla"); ds.setMaxActive(20); ds.setMaxIdle(20); ds.setTestOnBorrow(true); ds.setTestOnReturn(true); ds.setTestWhileIdle(true); ds.setValidationQuery("select tf_dbcp_test.nextval from dual"); // get connection and return it to simulate some usage PreparedStatement stmt =3D conn.prepareStatement("select * from bla"); ResultSet result =3D stmt.executeQuery(); result.next(); System.out.println("fly product is " + result.getString(1)); conn.commit(); result.close(); stmt.close(); conn.close(); // get another connection conn =3D ds.getConnection(); conn.close(); I'd expect that dbcp would execute the validation query four times (2 * on borrow and 2 * on return). Though, the sequence has not been incremented. Any tips? Thanks, Thomas ------_=_NextPart_001_01C57E8A.E8F4F0D4--