Re: Using Postgresql under IBM WebSphere

From: Ned Wolpert <ned(dot)wolpert(at)knowledgenet(dot)com>
To: Marcel Fréchette <marcel(dot)frechette(at)videotron(dot)ca>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Using Postgresql under IBM WebSphere
Date: 2001-11-29 17:33:55
Message-ID: XFMail.20011129103355.ned.wolpert@knowledgenet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Some comments I have inlined...

> I used the JDBC driver of Postgresql 7.1.3 (which I compiled
> from the sources, as explained elsewhere on this list).
> But as far as I can see, my findings still apply in 7.2b3.
>
> 1) In org.postgresql.xa.XADataSourceImpl.getTxRecover(),
> the return statement:

I don't believe (but someone else may know better) that this is complete
anyways. Is it possible to get WebSphere to use a regular jdbc1 driver
(org.postgresql.Driver) rather than a data source? Another option is to use
PoolMan (www.codestudio.com) to get access to the org.postgresql.Driver class
since PoolMan can provide a DataSource object that calls the driver itself.

(I'm working on getting the driver up to jdbc2.0 and jdbc2.0Optional snuff,
but I'm not going to submit more code until after 7.2 is released since my
code is too new. I think to make WebSphere happy, you have to treat the
driver as a JDBC1 level driver directly with webspehere, or use PoolMan to
wrap a JDBC2 level driver/DataSource to make WebSphere happy)

> 3) Websphere frequently logs this warning:
>
> PortabilityLa W CONM0002W: Unrecognized database or driver
> org.postgresql.PostgresqlDataSource; using generic settings
>
> So is seems to me that Websphere expects something from data sources
> that it does not find with the Postgresql one.

Nah, I think its because WebSphere doesn't understand PostgreSQL specific
calls, so its using the driver generically. The DB2 driver has methods that
are specific to DB2 and WebSphere will 'cast' the driver to a know version to
access those methods. This shouldn't be a problem.

> 4) Configuring a Postgresql data source in WebSphere.
[..deleted..]
Thats a good list of info for configuring WebSphere.

> Now in order to get my limited success (inserted one row)
> I had to do a couple of patches that are *certainly* not solutions.
> In fact, those patches are the main reason why I pretend
> that Postgresql currently won't work under WebSphere.
> But they let me go ahead a bit.

> 5) In org.postgresql.xa.XADataSourceImpl.getXAConnection(String, String),
> I replaced the throw statement with 'return getXAConnection();'.

> 6) In org.postgresql.PostgresqlDataSource.getConnection(String, String)
> I supplied default user/password values when one is null,
> like this (that's about in the middle of the method):
>
> if ( user == null || password == null )
> {
> // Supply defaults if needed.
> if (user == null) user = "mf";
> if (password == null) password = "x";
> // throw new PSQLException( "postgresql.ds.userpswd" );
> }

I've posted (for use with 7.3) a class that reads properties for the
postgresql driver which I'm going to update shortly. It will help here by
having a place to look up defaults that the user/admin can control.

> In short, I have problems passing the user/password, regardless of where
> I specify them in my EJB code or in the data source definition in the
> WebSphere admin tool. It seems WebSphere always calls
> getXAConnection(String, String) and
> getConnection(String, String), perhaps with null values?

Does WebSphere require a JDBC2 level driver?

> And I have problems with transactions too, btw.

Are you having problems with the XA code base? I believe that the postgresql
driver code for the XA methods are incomplete. Also, WebSphere is likely
assuming the database is able to do two-phase commits which PostgreSQL
cannot. It would be interesting to see if wrapping with PoolMan provides
enough functionality to keep WebSphere happy enough to complete multiple
transactions.

Virtually,
Ned Wolpert <ned(dot)wolpert(at)knowledgenet(dot)com>

D08C2F45: 28E7 56CB 58AC C622 5A51 3C42 8B2B 2739 D08C 2F45
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE8BnGCiysnOdCML0URAitTAJ0d9ny5/codKN6tx9ZaRZ4u4vCLSACcDmMD
rcN1yN6PbCkrFotU5xHPowc=
=DTGQ
-----END PGP SIGNATURE-----

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Marcel Fréchette 2001-11-29 17:35:30 Using Postgresql under IBM WebSphere
Previous Message Barry Lind 2001-11-29 17:32:35 Re: CallableStatements