Return-Path: X-Original-To: apmail-tomcat-users-archive@www.apache.org Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D473A10223 for ; Wed, 3 Dec 2014 18:47:34 +0000 (UTC) Received: (qmail 10494 invoked by uid 500); 3 Dec 2014 18:47:31 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 10423 invoked by uid 500); 3 Dec 2014 18:47:31 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 10412 invoked by uid 99); 3 Dec 2014 18:47:31 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Dec 2014 18:47:31 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [74.125.82.51] (HELO mail-wg0-f51.google.com) (74.125.82.51) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Dec 2014 18:47:06 +0000 Received: by mail-wg0-f51.google.com with SMTP id k14so20501490wgh.38 for ; Wed, 03 Dec 2014 10:47:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=71ilI5H7o92TmqwOfCg2Oom57le2m18Gi0nB8t+uLV4=; b=Ez9GclDbmtILDg2VZTWdX650g8asWLhklcncJ+vPXRG9p8l3hQZZVuR6RnfkV/7NMb jODWLHqtLeadg9G6X5/b5F8qJmVYEwDqNbNDYb5/1iOqei0YGCjQkkYO/aWGSbvEnv3U N/0hjD/0F4Tmg2Bhetzoj/Iwo1SSqRAu+gzEGMFuMG2y3FkOqbUYA2VYWMwf51kbxkZt 5PIKYRoau0noQsd1w7lTX8S6506egoZQEuR91bVZ/MeHGOZxcgwLmk5Abdy/adhE8LPi S5ovhNHB6arREHV0lpvZXSJd00L9v6c1aplLzXxQci9+ns8UfFy6ehKnrwauyNOlzabD zN5g== X-Gm-Message-State: ALoCoQlHrMrY9xZXIhxzyh4Pmxaje7zUmyJ4vdLY5enC30yu15X5on5OR2mA63iOMrf2RTCau3zS MIME-Version: 1.0 X-Received: by 10.194.7.97 with SMTP id i1mr1185432wja.31.1417632425410; Wed, 03 Dec 2014 10:47:05 -0800 (PST) Received: by 10.194.237.66 with HTTP; Wed, 3 Dec 2014 10:47:05 -0800 (PST) In-Reply-To: References: Date: Wed, 3 Dec 2014 11:47:05 -0700 Message-ID: Subject: Re: Tomcat JDBC connection pool: Using initSql together with validatorClassName From: Filip Hanik To: Tomcat Users List Cc: Iris Hupkens Content-Type: multipart/alternative; boundary=047d7b5d86a5239b56050954458a X-Virus-Checked: Checked by ClamAV on apache.org --047d7b5d86a5239b56050954458a Content-Type: text/plain; charset=UTF-8 You should be able to run init SQL commands yourself in your custom validator https://tomcat.apache.org/tomcat-7.0-doc/api/org/apache/tomcat/jdbc/pool/Validator.html On Wed, Dec 3, 2014 at 11:42 AM, Wes Clark wrote: > These actions seems to incorrectly conflated in the code. I'd also like > to do the same thing, so if you get it working, keep me posted. > > -----Original Message----- > From: Iris Hupkens [mailto:I.Hupkens@topdesk.com] > Sent: Wednesday, December 03, 2014 5:14 AM > To: 'users@tomcat.apache.org' > Subject: Tomcat JDBC connection pool: Using initSql together with > validatorClassName > > Hello, > > I am using the Tomcat JDBC connection pool (version 7.0.55) as a > stand-alone library. The connection pool is configured with a custom > validator class in order to use the JDBC4 isValid method for connection > validation. I would also like to use initSql to perform some preparation > on all connections created in the pool (such as setting sorting to case > insensitive under Oracle). However, it appears that initSql does not work > in combination with a validator class. > > Looking at the source, the code that executes the initSql statement is > skipped if a validator class is configured. The documentation for initSql > states that it is executed in place of the validation query when > connections are initialized, but the method which does the validation first > checks if there is a validator class that should be used instead, and then > returns immediately. > > I was wondering: is this a bug, or is it intentionally not possible? If > it's intentional, is there perhaps a different way to configure the Tomcat > connection pool to use both a custom validator class and execute initial > SQL statements when first creating a connection? > > Kind regards, > Iris Hupkens > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org > For additional commands, e-mail: users-help@tomcat.apache.org > > --047d7b5d86a5239b56050954458a--