Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 3A0FD1337BBA for ; Tue, 28 Dec 2010 06:15:46 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 11984-06-2 for ; Tue, 28 Dec 2010 10:15:39 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from hogranch.com (hogranch.com [75.101.82.47]) by mail.postgresql.org (Postfix) with ESMTP id 813051337BDA for ; Tue, 28 Dec 2010 06:15:29 -0400 (AST) Received: from [127.0.0.1] (porker [192.168.0.2]) by hogranch.com (8.11.6/8.11.6) with ESMTP id oBSAFR809918 for ; Tue, 28 Dec 2010 02:15:27 -0800 Message-ID: <4D19B8BA.10108@hogranch.com> Date: Tue, 28 Dec 2010 02:15:22 -0800 From: John R Pierce User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.13) Gecko/20101207 Lightning/1.0b2 Thunderbird/3.1.7 MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org Subject: Re: PostgreSQL Authentication and Pooling in JBoss : static 'postgres' user VS dynamic jboss user References: <201012281200.11993.achill@matrix.gatewaynet.com> In-Reply-To: <201012281200.11993.achill@matrix.gatewaynet.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-HawgScanner-Information: Please contact the ISP for more information X-HawgScanner: Found to be clean X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201012/80 X-Sequence-Number: 21318 On 12/28/10 2:00 AM, Achilleas Mantzios wrote: > Hello, and merry xmas, > Traditionally we have been using jboss JCA pools with postgresql by having every connection authenticate > against the static postgres user, or 3 other predifined static users. > This was working ok, but made debugging hard, there was no way to confidently link log from the jboss log > with log from postgresql, or just find out which user causes a faulty situation. The pgsql user was also one of those 4. > Lately i have been thinking of authenticating the connections in jboss JCA pools against the active web user, > i configured it, and it actually works in some tests i made. I find this more attractive, since it will give much better statistics, > ( i would trust pgsql stats over jboss stats). > What i'd like to ask, is if anyone of you has done this and had a good experience. The resaons why i ask, is that > documentation in jboss is minimal regarding this issue, and the commonly usual practice is to use the same > user when creating connections in the pool. I should ask the jboss ppl as well, but my experiences on their camp > were not very encouraging (i never got any serious feedback from there). > > Well, i'd just like to hear your thoughts on that. I can't address jboss specific issues, but in general in postgres, all the connections in a given pool have to be authenticated as the same postgres user, otherwise you're reconnecting to postgres to authenticate different users each time which defeats the whole purpose of a connection pool.... so, are you thinking of creating a pool for each web user?!? that could get messy fast.