X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 35C40DB34B for ; Wed, 23 Nov 2005 09:24:46 -0400 (AST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 78426-01 for ; Wed, 23 Nov 2005 13:24:48 +0000 (GMT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mra01.ch.as12513.net (mra01.ch.as12513.net [82.153.252.23]) by svr1.postgresql.org (Postfix) with ESMTP id 7016FDB0B5 for ; Wed, 23 Nov 2005 09:24:43 -0400 (AST) Received: from localhost (localhost [127.0.0.1]) by mra01.ch.as12513.net (Postfix) with ESMTP id E8DF728C605; Wed, 23 Nov 2005 13:24:46 +0000 (GMT) Received: from mra01.ch.as12513.net ([127.0.0.1]) by localhost (mra01.ch.as12513.net [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 07770-01-31; Wed, 23 Nov 2005 13:24:45 +0000 (GMT) Received: from [10.0.0.151] (unknown [81.5.146.249]) by mra01.ch.as12513.net (Postfix) with ESMTP id 38F3628C736; Wed, 23 Nov 2005 13:24:44 +0000 (GMT) Message-ID: <43846D95.9070602@rkcomputing.co.uk> Date: Wed, 23 Nov 2005 13:24:37 +0000 From: Rob Kirkbride User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Oliver Jowett CC: pgsql-jdbc@postgresql.org Subject: Re: Switching user within connection. References: <43843F94.6070900@rkcomputing.co.uk> <43844B2F.1010309@opencloud.com> <43844DCC.3040705@rkcomputing.co.uk> <438452D9.8020402@opencloud.com> In-Reply-To: <438452D9.8020402@opencloud.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by Eclipse VIRUSshield at eclipse.net.uk X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0 required=5 tests=[none] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200511/170 X-Sequence-Number: 14268 Oliver Jowett wrote: > Rob Kirkbride wrote: > >> Thanks for your reply. I think I'd guessed that would be the reply. >> It's probably off topic really now but I wanted to maintain a series >> of pooled connections but with potentially different users. I got >> lost reading the JCA documentation which may do something clever but >> I'm guessing if the underlying JDBC driver doesn't support it then >> there's not a lot it can do really. > > > My JCA is a bit rusty, but from memory the way you deal with this is > by implementing ManagedConnectionFactory.matchManagedConnections() to > only consider connections that have matching authentication info. So > the container can maintain a single pool of connections, but when it > asks the connector for a suitable connection authenticated as Joe then > only connections in the pool that are already authenticated as Joe are > considered. > > You may end up needing more connections in the pool depending on the > actual usage pattern, but you don't need to reauthenticate on an > existing connection. > Thanks for you help - I see yes what you've given would be helpful. However I'm struggling at the moment to work out how to configure JCA on JBoss using Hibernate. But I guess that's a question for another forum! Thanks again Oliver. Rob