Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 0AFB4633B89 for ; Sun, 15 Mar 2009 21:58:47 -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 37168-10 for ; Sun, 15 Mar 2009 21:58:36 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from tremor.opencloud.co.nz (tremor.opencloud.co.nz [131.203.101.230]) by mail.postgresql.org (Postfix) with ESMTP id 319B1633B36 for ; Sun, 15 Mar 2009 21:58:43 -0300 (ADT) Received: from 122-57-37-178.jetstream.xtra.co.nz ([122.57.37.178] helo=[192.168.1.3]) by tremor.opencloud.co.nz with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1Lj1A5-0002r8-Sr; Mon, 16 Mar 2009 13:58:38 +1300 Message-ID: <49BDA43C.7000308@opencloud.com> Date: Mon, 16 Mar 2009 13:58:36 +1300 From: Oliver Jowett User-Agent: Thunderbird 2.0.0.19 (X11/20090105) MIME-Version: 1.0 To: peter CC: pgsql-jdbc@postgresql.org Subject: Re: Totally weird behaviour in org.postgresql.Driver 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> In-Reply-To: <49bcfe15$0$1344$834e42db@reader.greatnowhere.com> X-Enigmail-Version: 0.95.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200903/80 X-Sequence-Number: 19410 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! ;) JCA's' pooling API in theory has the ability to distinguish different connections on the basis of credentials (and you can map that to JDBC), but I'm not sure if there are any pool implementations out there that make use of it. You'd need some decent pool logic to avoid thrashing connections depending on the number of unique users you have. -O