Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 56851 invoked from network); 2 Feb 2009 09:18:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Feb 2009 09:18:46 -0000 Received: (qmail 51395 invoked by uid 500); 2 Feb 2009 09:18:34 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 51370 invoked by uid 500); 2 Feb 2009 09:18:34 -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 51359 invoked by uid 99); 2 Feb 2009 09:18:34 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Feb 2009 01:18:34 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of kdekooter@gmail.com designates 74.125.78.149 as permitted sender) Received: from [74.125.78.149] (HELO ey-out-1920.google.com) (74.125.78.149) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Feb 2009 09:18:25 +0000 Received: by ey-out-1920.google.com with SMTP id 26so174299eyw.12 for ; Mon, 02 Feb 2009 01:18:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=LjrNoXTO4+dZVFh52gPIjwuBKxpmNAJafMGpiBo706M=; b=opp/+N8iV4FJ5GBMCFAgsCnN1DGAUx595M4+AKC+YqmQf0BVlhiz+yvrVQ4jR95yZx PnmjU38b3mVPzxmi0imaqzQeDKH+V9Dai/die+p5gjFbmhappMRB9kRnLm2elHjRv5sX 2RuoQMS9aS3jMpqIPWr2pRrCg+5CPnNQK3oXA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=Bz2NNS0OtR4uzyURn69//cZ3C+Yh/qvhXVF9FlTrR4BVqEg6eg1f74uKNfRXc27oN/ W1ZDfpTUTY1Lk+oZ2J7laVhyPDqyY6KsN9MM2JnF8k2wKo1P/PKAEi1qz1knI2X/KzBr 5RNP9QiFBt4JSxrEZc6sa6yLMPK2q00h2SnN0= MIME-Version: 1.0 Received: by 10.210.68.17 with SMTP id q17mr4513966eba.50.1233566284482; Mon, 02 Feb 2009 01:18:04 -0800 (PST) In-Reply-To: <1233528916.6298.317.camel@rainbow.rainbowapps.com> References: <1233528916.6298.317.camel@rainbow.rainbowapps.com> Date: Mon, 2 Feb 2009 10:18:04 +0100 Message-ID: Subject: Re: Tomcat 6 on Linux - session - DB connections and other shared resources From: Kees de Kooter To: Tomcat Users List Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Servlet filters are the best way to solve this. Where do you get stuck with filters? Cheers, Kees de Kooter http://www.boplicity.net On Sun, Feb 1, 2009 at 23:55, Ray Holme wrote: > I have a few web applications being moved to tomcat. They all share some > commonality - I use Firebird not MySQL; I built my own ConnectionManager > long ago; and all three have an Application wide bean for shared > resources. Each user has a "UserInfo" bean (whether or not they log in > is important and can be found, but all functions require the common > resources and it is a VERY convenient place to put them) from which > hangs a DB-Connection bean and an Application bean. This enables > resources to be pooled (connections) and shared (Application). > > Perhaps due to lack of knowledge, I try get the session's UserInfo > (getAttribute(..)) and on failure intstantiate a new one in hundreds of > servlets and/or JSP servlet codes sets (adding resources as needed). > > I am sure that there must be some reasonable way to have all of the > servlets (no matter what form) go through some preliminary code, and > some post processing in order not to write the same code into hundreds > of places (and be sure the post processing routine which frees up > resources is ALWAYS executed). > > I have tried to do this with filterchains but am failing so far - due to > ignorance or whatever. I realize that I could modify the source and do > it, but that seems counter productive as this seems like a fairly common > need. > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org > For additional commands, e-mail: users-help@tomcat.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org