Re: Re: JDBC Performance

From: Peter Mount <peter(at)retep(dot)org(dot)uk>
To: Gunnar R|nning <gunnar(at)candleweb(dot)no>
Cc: "Keith L(dot) Musser" <kmusser(at)idisys(dot)com>, PGSQL-General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Re: JDBC Performance
Date: 2000-10-02 10:50:10
Message-ID: Pine.LNX.4.21.0010021147130.420-100000@maidast.demon.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-jdbc

On 29 Sep 2000, Gunnar R|nning wrote:

> "Keith L. Musser" <kmusser(at)idisys(dot)com> writes:
>
> > Gunnar,
> >
> > Your new JDBC driver (postgresql.jar, 29-Sept-2000, 14:47, 187K) caused
> > the following error.
> >
>
> >
> > SELECT host, port FROM Servers WHERE PID=1;
> > Bad Integer int4
> > at org.postgresql.jdbc2.ResultSet.getInt(ResultSet.java:261)
> > at org.postgresql.jdbc2.ResultSet.getObject(ResultSet.java:748)
> > at org.postgresql.jdbc2.ResultSet.getObject(ResultSet.java:789)
>
> OK, I found the problem. I will post a fixed version later today. The
> problem was that getObject() executed Field.getSQLType() which in turn
> executed Connection.ExecSQL(). I modified ExecSQL to deallocate the cached
> byte arrays on entry, because I believed it only were called by
> Statement.execute() methods. I guess I should move the deallocation into
> the Statement classes instead, as that is were it really belongs.
>
> I interpret the JDBC spec. to say that only one ResultSet will be open
> per. Statement, but one Connection canm have several statements with one
> result set each.

That is true, but you have to be careful of some of the DatabaseMetaData
methods as well, as some of them do issue their own queries to get their
results. It would be a pain to create new Statements just for them.

This area also has problems when transactions are being used, but without
nested transactions, it's a known problem :-(

Peter

--
Peter T Mount peter(at)retep(dot)org(dot)uk http://www.retep.org.uk
PostgreSQL JDBC Driver http://www.retep.org.uk/postgres/
Java PDF Generator http://www.retep.org.uk/pdf/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Peter Mount 2000-10-02 11:01:38 Re: Re: JDBC Performance
Previous Message Peter Mount 2000-10-02 10:45:55 Re: Re: JDBC Performance

Browse pgsql-jdbc by date

  From Date Subject
Next Message Peter Mount 2000-10-02 11:01:38 Re: Re: JDBC Performance
Previous Message Gunnar R|nning 2000-09-29 17:35:39 Re: Re: JDBC Performance