Skip site navigation (1) Skip section navigation (2)

Re: Switching user within connection.

From: Rob Kirkbride <rob(at)rkcomputing(dot)co(dot)uk>
To: Oliver Jowett <oliver(at)opencloud(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Switching user within connection.
Date: 2005-11-23 13:24:37
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-jdbc
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.


In response to

pgsql-jdbc by date

Next:From: Thomas KellererDate: 2005-11-23 17:43:06
Subject: Why is bool == java.sql.Types.BIT ??
Previous:From: Dave CramerDate: 2005-11-23 13:13:15
Subject: Re: Can PostgreSQL do data type automated casting in prepared

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group