Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 10886133740B for ; Tue, 28 Dec 2010 08:05:25 -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 25681-10 for ; Tue, 28 Dec 2010 12:05:18 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from smadev.internal.net (host3.dynacom.ondsl.gr [62.103.35.211]) by mail.postgresql.org (Postfix) with ESMTP id 3903A1336B42 for ; Tue, 28 Dec 2010 08:05:15 -0400 (AST) Received: from smadev.internal.net (localhost.internal.net [127.0.0.1]) by smadev.internal.net (8.14.2/8.14.2) with ESMTP id oBSC58vq092442 for ; Tue, 28 Dec 2010 14:05:08 +0200 (EET) (envelope-from achill@matrix.gatewaynet.com) Received: from localhost (localhost [[UNIX: localhost]]) by smadev.internal.net (8.14.2/8.14.2/Submit) id oBSC585R092441 for pgsql-jdbc@postgresql.org; Tue, 28 Dec 2010 14:05:08 +0200 (EET) (envelope-from achill@matrix.gatewaynet.com) From: Achilleas Mantzios Organization: Dynacom Tankers Mgmt To: pgsql-jdbc@postgresql.org Subject: Re: PostgreSQL Authentication and Pooling in JBoss : static 'postgres' user VS dynamic jboss user Date: Tue, 28 Dec 2010 15:05:08 +0300 User-Agent: KMail/1.9.7 References: <201012281200.11993.achill@matrix.gatewaynet.com> <4D19B8BA.10108@hogranch.com> In-Reply-To: <4D19B8BA.10108@hogranch.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <201012281405.08236.achill@matrix.gatewaynet.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.451 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_BRBL_LASTEXT=1.449 X-Spam-Level: X-Archive-Number: 201012/81 X-Sequence-Number: 21319 =CE=A3=CF=84=CE=B9=CF=82 Tuesday 28 December 2010 12:15:22 =CE=BF/=CE=B7 Jo= hn R Pierce =CE=AD=CE=B3=CF=81=CE=B1=CF=88=CE=B5: > 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 hav= ing 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 confi= dently link log from the jboss log > > with log from postgresql, or just find out which user causes a faulty s= ituation. 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 thi= s 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 commonl= y 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. >=20 > I can't address jboss specific issues, but in general in postgres, all=20 > the connections in a given pool have to be authenticated as the same=20 > postgres user, otherwise you're reconnecting to postgres to authenticate= =20 > different users each time which defeats the whole purpose of a=20 > connection pool.... so, are you thinking of creating a pool for each=20 > web user?!? that could get messy fast. >=20 Yes that's the logic. One connection pool per user. I find it more clever, fine grained and just better from many perspectives = (security/auditing/diagnosis/debugging being the main ones). We have LDAP based authentication in Jboss. And i use the very same LDAP se= rver for postgresql authentication as well. So i have one point of authentication for both Jboss, PostgreSQL, the very = same LDAP server. User logs in, and his credentials are delegated to PostgreSQL with *no* inv= olvement of any application code. So from a one-user monolithic declarative model we can go now on fully mult= i sql user, with *no changes* in the app, or the .EAR configuration!!! As we speak i am testing it with max 4 connections/user. Both systems (postgresql, jboss) support this as is, with just recompilatio= n (postgresql) / configuration (jboss). The main question is twofold: If any one has any theoretical objections to = this model, and 2nd if anyone has encountered any problems by using this or smth simila= r. >=20 >=20 >=20 >=20 >=20 >=20 =2D-=20 Achilleas Mantzios