patch: fix ResultSet.isLast and friends with cursor-based resultsets

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: "pgsql-jdbc(at)postgresql(dot)org" <pgsql-jdbc(at)postgresql(dot)org>
Subject: patch: fix ResultSet.isLast and friends with cursor-based resultsets
Date: 2004-04-09 13:53:59
Message-ID: 4076AAF7.10106@opencloud.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

The attached patch fixes (and adds testcases for) the various resultset
position querying methods (isFirst, isLast, isBeforeFirst, isAfterLast)
that can be called on any resultset. The current driver does not handle
these methods correctly when a TYPE_FORWARD_ONLY resultset that is
backed by a cursor is used.

isLast() may be more expensive after this patch (as it may need to do a
FETCH), but this cost is warned about in the JDBC javadoc.

A couple of other changes also in this patch:

- prevent use of relative row movement methods (relative, next,
previous) when on the insert row -- as I read the spec these shouldn't
be allowed.
- reset onInsertRow whenever an absolute row positioning method is called.

-O

Attachment Content-Type Size
pgjdbc_resultset_positioninfo_fixes.txt text/plain 14.5 KB

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Rein Reezigt 2004-04-09 14:37:06 cannot connect to db from remote machine
Previous Message Hans-Jürgen Schönig 2004-04-09 11:38:57 Re: [OT] Porting from Oracle [was Connection Idle in transaction]