pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rob Kirkbride <rob@rkcomputing.co.uk>
To: Oliver Jowett <oliver@opencloud.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Switching user within connection.
Date: Wed, 23 Nov 2005 13:24:37 +0000
Message-ID: <43846D95.9070602@rkcomputing.co.uk> (raw)
In-Reply-To: <438452D9.8020402@opencloud.com>
References: <43843F94.6070900@rkcomputing.co.uk>
	<43844B2F.1010309@opencloud.com>
	<43844DCC.3040705@rkcomputing.co.uk>
	<438452D9.8020402@opencloud.com>

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




view thread (6+ messages)

Message-ID: <43846D95.9070602@rkcomputing.co.uk>
Permalink:  ../43846D95.9070602@rkcomputing.co.uk/
Also on:    postgresql.org/message-id/43846D95.9070602@rkcomputing.co.uk

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: rob@rkcomputing.co.uk, oliver@opencloud.com
  Subject: Re: Switching user within connection.
  In-Reply-To: <43846D95.9070602@rkcomputing.co.uk>
  References: <43843F94.6070900@rkcomputing.co.uk> <43844B2F.1010309@opencloud.com> <43844DCC.3040705@rkcomputing.co.uk> <438452D9.8020402@opencloud.com> <43846D95.9070602@rkcomputing.co.uk>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox