Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 6577C633EE8 for ; Mon, 16 Mar 2009 12:25:33 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 55411-07 for ; Mon, 16 Mar 2009 12:25:23 -0300 (ADT) Received: from mx2.hub.org (mx2.hub.org [200.46.204.254]) by mail.postgresql.org (Postfix) with ESMTP id 53EBC6343A3 for ; Mon, 16 Mar 2009 12:25:12 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from yx-out-2324.google.com (yx-out-2324.google.com [74.125.44.30]) by mx2.hub.org (Postfix) with ESMTP id 656BE1E82DBF for ; Mon, 16 Mar 2009 09:19:46 -0300 (ADT) Received: by yx-out-2324.google.com with SMTP id 3so1605777yxj.73 for ; Mon, 16 Mar 2009 05:19:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type; bh=iWzBkZGxfg01OkUBX27wCJOTqcsi4Yfd83WimqgN73s=; b=yIVmyFP1RzbUaVvmwnMtPLDkWqjjc/sqwNx5SXgsAbWu29h93K4nFJlGnflXaTFk5F AaRm99OJ02KyrglzgWZTc8qhDV+hIAOgxtwpPWySbU02r1Sby+YQcRSfcD0dCvDrPfbp qZ3+EvlbcmT5/oa0G9F7mQdaputf/cfMexQrc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=FqZJFsSQXyH4x7tfOFKw4EpiaVUMffBbcK1NNAgby7bovuscz/9/N2yZ/dRVNlf/NG gYAiMVcufT601lqC8XUMulbgyo3S7h+ryRqI9xIh2HVGG05lrqWj+joeULk5fCwJTCuR i2uyBPuS6ZuE0mJMA2itj93GM1+NE7sN402G0= MIME-Version: 1.0 Received: by 10.90.68.20 with SMTP id q20mr568591aga.50.1237197449913; Mon, 16 Mar 2009 02:57:29 -0700 (PDT) In-Reply-To: <49BDABC7.3030108@burntmail.com> References: <49b7bfef$0$1343$834e42db@reader.greatnowhere.com> <491f66a50903120342j67e87c7dob10cfdc23580c8f4@mail.gmail.com> <003001c9a315$a68a9330$f39fb990$@com> <200903121341.59498.cservin@cromagnon.com> <49bca9e8$0$1341$834e42db@reader.greatnowhere.com> <491f66a50903150409y648b448pc3825ef4fc1ed7e@mail.gmail.com> <49bcfe15$0$1344$834e42db@reader.greatnowhere.com> <49BDABC7.3030108@burntmail.com> Date: Mon, 16 Mar 2009 05:57:29 -0400 X-Google-Sender-Auth: d023798971502353 Message-ID: <491f66a50903160257m3cd01c07v828a33fab173e775@mail.gmail.com> Subject: Re: Totally weird behaviour in org.postgresql.Driver From: Dave Cramer To: Guy Rouillier Cc: pgsql-jdbc@postgresql.org Content-Type: multipart/alternative; boundary=001636163f4184e78f0465397ac1 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200903/84 X-Sequence-Number: 19414 --001636163f4184e78f0465397ac1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On Sun, Mar 15, 2009 at 9:30 PM, Guy Rouillier wrote: > peter wrote: > >> Thanks for sharing the tip! What adjustments exactly did >>> you >>> have to make? I >>> just make every user to log on with different PG username. Are >>> there any >>> other options? >>> >>> It's fairly unusual to have a tomcat application of any size login to >>> the db as the user. Could you share the reason why ? >>> >>> >> The app is actually middleware for Adobe Flex frontend and PG backend, >> not a regular web app. The architecture requires PG to know which user >> has connected (lots of heavy lifting takes place in PG), and we so far >> havent found any other way how to let PG know which user has connected. >> The only alternative was to supply user ID in every PG function call but >> that is messy and introduces it's own limitations as well. If you have >> any suggestions I'm all ears! ;) >> > > Set a user variable after you've obtained a connection from the pool, and > use that to log user-specific values. That way, you maintain the benefits > of connection pools, but can still identify individual users. > It would seem to me that if you need to scale this app then you are going to have to set the user in the application somewhere. Having all of the users connect as themselves doesn't lend itself to being scalable. Dave > > --001636163f4184e78f0465397ac1 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

On Sun, Mar 15, 2009 at 9:30 PM, Guy Rou= illier <guyr= -ml1@burntmail.com> wrote:
peter wrote:
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Thanks for sharing the tip! What adjustment= s exactly did you
=A0 =A0 =A0 =A0have to make? I
=A0 =A0 =A0 =A0just make every user to log on with different PG username. = Are
=A0 =A0 =A0 =A0there any
=A0 =A0 =A0 =A0other options?

It's fairly unusual to have a tomcat application of any size login to the db as the user. Could you share the reason why ?


The app is actually middleware for Adobe Flex frontend and PG backend,
not a regular web app. The architecture requires PG to know which user
has connected (lots of heavy lifting takes place in PG), and we so far
havent found any other way how to let PG know which user has connected.
The only alternative was to supply user ID in every PG function call but that is messy and introduces it's own limitations as well. If you have<= br> any suggestions I'm all ears! ;)

Set a user variable after you've obtained a connection from the pool, a= nd use that to log user-specific values. =A0That way, you maintain the bene= fits of connection pools, but can still identify individual users.

It would seem to me that if you need to scale this ap= p then you are going to have to set the user in the application somewhere. = Having all of the users connect as themselves doesn't lend itself to be= ing scalable.

Dave