From: Craig Ringer <craig@postnewspapers.com.au>
To: Simon Riggs <simon@2ndQuadrant.com>
Cc: Dave Cramer <pg@fastcrypt.com>
Cc: List <pgsql-jdbc@postgresql.org>
Subject: Re: JDBC gripe list
Date: Tue, 29 Mar 2011 08:05:03 +0800
Message-ID: <4D91222F.3010706@postnewspapers.com.au> (raw)
In-Reply-To: <AANLkTi=NmA5aqiFV_7EsJXrMtYJu8t3CpyYqTA_Xbs2=@mail.gmail.com>
References: <AANLkTik0kW5_jCAc7h0T_Q5cCGx=tunasHJ=nf0X=+ij@mail.gmail.com>
<AANLkTi=NmA5aqiFV_7EsJXrMtYJu8t3CpyYqTA_Xbs2=@mail.gmail.com>
On 03/25/2011 04:07 PM, Simon Riggs wrote:
> On Fri, Mar 25, 2011 at 12:35 AM, Dave Cramer<pg@fastcrypt.com> wrote:
>> Just got back from pgeast. Seems everyone seems to have a gripe about
>> the JDBC driver.
>>
>> My sense is that for basic read/write/update/delete the driver works
>> just fine. However I'd like to compile a list of everyone's gripe.
>
> Funny that, I just got back from a different conference where people
> were griping about it also.
>
> Didn't get a detailed list but numbers of less impressed people all
> active Postgres users and supporters.
Personally, I think the JDBC driver is fine. It's not perfect, but I
hardly feel justified "demanding" a perfect driver when I haven't
contributed anything to its creation. People appear to be very happy to
complain, but rather less willing to knuckle down and help!
I'm not using the JDBC driver heavily and generally find that it does
the job quite well. Also, a least I put in the effort to fix one issue -
the core code's handling of client certs requests when multiple certs
are in the Keystore. Not that anyone seems to _use_ X.509 client
certificates...
The only actual issues I've run into, none of which were exactly
showstoppers though all of which cost me significant time finding
workarounds, are:
- (biggest problem) The JDBC driver interacts poorly with PostgreSQL 8.3
and above's removal of implicit casts when using extended Pg types,
user-defined types, etc. It's often desirable to represent a type in
Java as String, BigDecimal, etc, though it's backed by a domain or a
custom type on the Pg side. The most painful time I've had with this was
working with Pg's xml type, which I needed to represent Java-side as a
string. This is ... painful ... with PgJDBC, especially if you're using
a midlayer like JPA2 so you can't use setObject(...) directly. When it's
a user-defined type you can define implicit casts, but it's IMO
unreasonable to have to go messing with the system catalog just to be
able to convert from xml <-> string for example.
Try writing a simple test program that handles the 'xml' type from
Hibernate or JPA to see what I mean.
IMO the server shouldn't be being so strict about implicit conversions
*from* string to certain string-like types like xml. Since that's
apparently not going to change, it'd be wonderful if the JDBC driver had
a way to detect the destination types and send data with the right type
when passed a string representation of the type.
- Inability to reliably receive notifications without risking blocking.
It's not possible to check for notifications w/o risking blocking on SSL
connections, and there's no way to ask the driver if the connection is
SSL or request that it only check for notifications if it can do so
safely without blocking indefinitely. Needs a new notification checking
method that, if it cannot guarantee that it's using a non-ssl
connection, sends a minimum client/server round trip and reads the response.
- Notifications, warnings, notices, etc can flood the receive buffer,
leading to deadlock if progress requires that more data be sent before a
read is attempted. This has been widely discussed, and the general
consensus appears to be that a worker thread for the driver would be
required in order to provide a general and reliable solution.
--
Craig Ringer
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: craig@postnewspapers.com.au, simon@2ndQuadrant.com, pg@fastcrypt.com
Subject: Re: JDBC gripe list
In-Reply-To: <4D91222F.3010706@postnewspapers.com.au>
References: <AANLkTik0kW5_jCAc7h0T_Q5cCGx=tunasHJ=nf0X=+ij@mail.gmail.com> <AANLkTi=NmA5aqiFV_7EsJXrMtYJu8t3CpyYqTA_Xbs2=@mail.gmail.com> <4D91222F.3010706@postnewspapers.com.au>
* 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