bug with PGXADataSource in JNDI

Lists: pgsql-jdbc
From: Jonathan Halliday <jonathan(dot)halliday(at)redhat(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: bug with PGXADataSource in JNDI
Date: 2007-02-23 20:56:49
Message-ID: [email protected]
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-jdbc


Hello JDBC driver developers

I have a requirement to store and retrieve PGXADataSource
instances from JNDI, specifically using Sun's fscontext
provider.

I can get instances into JNDI no problem and they are
written out to the .bindings file.

I can't retrieve them because
PGObjectFactory.getObjectInstance does not know about
ClassName=org.postgresql.xa.PGXADataSource

Please would one of the developers address this for the next
8.1 driver release.

Thanks

Jonathan Halliday
JBoss, a division of Red Hat


From: Heikki Linnakangas <heikki(at)enterprisedb(dot)com>
To: Jonathan Halliday <jonathan(dot)halliday(at)redhat(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: bug with PGXADataSource in JNDI
Date: 2007-02-26 16:19:29
Message-ID: [email protected]
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-jdbc

Jonathan Halliday wrote:
>
> Hello JDBC driver developers
>
> I have a requirement to store and retrieve PGXADataSource instances from
> JNDI, specifically using Sun's fscontext provider.
>
> I can get instances into JNDI no problem and they are written out to the
> .bindings file.
>
> I can't retrieve them because PGObjectFactory.getObjectInstance does not
> know about ClassName=org.postgresql.xa.PGXADataSource
>
> Please would one of the developers address this for the next 8.1 driver
> release.

I can write the patch to fix that. Do you happen to have a simple test
case I can use to test it?

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com


From: Heikki Linnakangas <heikki(at)enterprisedb(dot)com>
To: Jonathan Halliday <jonathan(dot)halliday(at)redhat(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: bug with PGXADataSource in JNDI
Date: 2007-02-26 17:02:42
Message-ID: [email protected]
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-jdbc

Heikki Linnakangas wrote:
> Jonathan Halliday wrote:
>>
>> Hello JDBC driver developers
>>
>> I have a requirement to store and retrieve PGXADataSource instances
>> from JNDI, specifically using Sun's fscontext provider.
>>
>> I can get instances into JNDI no problem and they are written out to
>> the .bindings file.
>>
>> I can't retrieve them because PGObjectFactory.getObjectInstance does
>> not know about ClassName=org.postgresql.xa.PGXADataSource
>>
>> Please would one of the developers address this for the next 8.1
>> driver release.
>
> I can write the patch to fix that. Do you happen to have a simple test
> case I can use to test it?

Thanks, I got your test case off-list.

Here's the patch against CVS head. It should apply cleanly to 8.1 branch
as well.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

Attachment Content-Type Size
xa-PGObjectFactory-fix.patch text/x-patch 1.6 KB

From: Kris Jurka <books(at)ejurka(dot)com>
To: Heikki Linnakangas <heikki(at)enterprisedb(dot)com>
Cc: Jonathan Halliday <jonathan(dot)halliday(at)redhat(dot)com>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: bug with PGXADataSource in JNDI
Date: 2007-02-26 17:20:07
Message-ID: [email protected]
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-jdbc

On Mon, 26 Feb 2007, Heikki Linnakangas wrote:

> Here's the patch against CVS head. It should apply cleanly to 8.1 branch as
> well.
>

This fails to compile for the JDBC2-EE driver because it supports
datasources, but not XA.

Kris Jurka


From: Heikki Linnakangas <heikki(at)enterprisedb(dot)com>
To: Kris Jurka <books(at)ejurka(dot)com>
Cc: Jonathan Halliday <jonathan(dot)halliday(at)redhat(dot)com>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: bug with PGXADataSource in JNDI
Date: 2007-02-26 18:30:37
Message-ID: [email protected]
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-jdbc

Kris Jurka wrote:
> On Mon, 26 Feb 2007, Heikki Linnakangas wrote:
>
>> Here's the patch against CVS head. It should apply cleanly to 8.1
>> branch as well.
>>
>
> This fails to compile for the JDBC2-EE driver because it supports
> datasources, but not XA.

Oh, I see. Here's another patch that introduces a new
PGXADataSourceFactory instead of modifying the existing PGObjectFactory.
It's a bit inconsistent that XADataSources have a factory of their own
while others use the plain PGObjectFactory, but I can't get too excited
about this..

How do you test the different builds? Do you need a separate, older JDK
to build each edition?

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

Attachment Content-Type Size
xa-PGObjectFactory-fix-2.patch text/x-patch 3.0 KB

From: Kris Jurka <books(at)ejurka(dot)com>
To: Heikki Linnakangas <heikki(at)enterprisedb(dot)com>
Cc: Jonathan Halliday <jonathan(dot)halliday(at)redhat(dot)com>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: bug with PGXADataSource in JNDI
Date: 2007-02-26 19:26:52
Message-ID: [email protected]
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-jdbc

On Mon, 26 Feb 2007, Heikki Linnakangas wrote:

> Oh, I see. Here's another patch that introduces a new PGXADataSourceFactory
> instead of modifying the existing PGObjectFactory. It's a bit inconsistent
> that XADataSources have a factory of their own while others use the plain
> PGObjectFactory, but I can't get too excited about this..

Applied to 8.1, 8.2, and CVS HEAD.

> How do you test the different builds? Do you need a separate, older JDK to
> build each edition?
>

Unfortunately yes, and finding linux machines I can still run 1.2 JDKs on
is getting tougher and tougher.

Kris Jurka