Return-Path: X-Original-To: apmail-tomcat-dev-archive@www.apache.org Delivered-To: apmail-tomcat-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C8118DEF9 for ; Mon, 20 May 2013 16:38:00 +0000 (UTC) Received: (qmail 26391 invoked by uid 500); 20 May 2013 16:29:38 -0000 Delivered-To: apmail-tomcat-dev-archive@tomcat.apache.org Received: (qmail 97104 invoked by uid 500); 20 May 2013 16:24:57 -0000 Mailing-List: contact dev-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Developers List" Delivered-To: mailing list dev@tomcat.apache.org Received: (qmail 46890 invoked by uid 99); 20 May 2013 16:06:43 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 May 2013 16:06:42 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of knst.kolinko@gmail.com designates 209.85.220.170 as permitted sender) Received: from [209.85.220.170] (HELO mail-vc0-f170.google.com) (209.85.220.170) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 May 2013 16:06:37 +0000 Received: by mail-vc0-f170.google.com with SMTP id gf11so2831270vcb.15 for ; Mon, 20 May 2013 09:06:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=UR0CO1l11Fu7m9nID507BD//qr6TITfQ86Op4OzSoPk=; b=sNHLwfWI9CEJT97RsOBCh6wq308BydREscKQQYi1qlLkYRaILY8e6bTpJwBnos6zGV 36pyJhA7cQ/3a04RLP9NeJogdH6mi99lQut8CXYsVYwSeQHDZ+d+HyBwX0eD9G79Vpwx 9OQSZkNhHhLlPyy5gZtkRWXzXpG6Qv8A3H4i5H7gXcboGXY0ty58x2q4gSmtXDoMDUu4 gEiwmICmAN2xZc8xSMDl0Oq9tDaqhTmWp5j7nr9mKib4qKCPB7GTF+30AdODq8XYPTpn VyI7MHOh7XeztH3x1gRUfpCNxeMAIAVxNd2b4hebkAvmhACJI2hdeze2c3gKSbl2VCyo glnw== MIME-Version: 1.0 X-Received: by 10.52.16.174 with SMTP id h14mr28964864vdd.59.1369065976714; Mon, 20 May 2013 09:06:16 -0700 (PDT) Received: by 10.58.75.38 with HTTP; Mon, 20 May 2013 09:06:16 -0700 (PDT) In-Reply-To: References: Date: Mon, 20 May 2013 20:06:16 +0400 Message-ID: Subject: Re: Why UserDatabaseRealm may use only resource from global JNDI but DataSourceRealm may use both global and local JNDI? From: Konstantin Kolinko To: Tomcat Developers List Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org 2013/5/18 outsider404 Gazeta.pl : > [Tomcat 7.0.x] > I wonder why UserDatabaseRealm use always global JNDI: > > ========== > Context context = getServer(). > getGlobalNamingContext(); > database = (UserDatabase) context.lookup(resourceName); > ========= > > but DataSourceRealm is more flexible: > > ========== > if (localDataSource) { > context = ContextBindings.getClassLoader(); > context = (Context) context.lookup("comp/env"); > } else { > context = getServer().getGlobalNamingContext(); > } > =========== > > Is it intentionally, for example for some security reason or it is open > improvement option for UserDatabaseRealm? I think it is just that nobody needed it. (From a quick look, I do not see anything that prevents such a feature). Feel free to prepare & test a patch. Best regards, Konstantin Kolinko --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org For additional commands, e-mail: dev-help@tomcat.apache.org