Re: deleteRow or updateRow after insertRow

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: jessica xingzc_he <xingzc_he(at)hotmail(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: deleteRow or updateRow after insertRow
Date: 2004-11-19 02:14:51
Message-ID: 419D571B.7080609@opencloud.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

jessica xingzc_he wrote:

> I do first:
> ResultSet.moveToInsertRow();
> ResultSet.update...(1, ...);
> ....
> rs.insertRow(); // a new row inserted into table
>
> but after that, I may move to some other row, say using
> Result.absolute(..) or so, and then
> 1. update
> ResultSet.update...(1, ...);
> ...
> ResultSet.updateRow(); // it does not update the corresponding row in
> the table, but also no
> exception thrown.
>
> 2. delete
> ResultSet.deleteRow(); // throws exception: Can not call deleteRow()
> when on insert row.

Both cases sound like the driver thinks you are on the insert row. Are
you sure that you are navigating away from the insert row after calling
insertRow() and are not returning to it for some reason?

Does the problem still occur if you use the latest development driver?
If so, do you have a testcase that demonstrates it?

It looks like updateRow when on the insert row is handle incorrectly :we
should throw an exception according to the javadoc, but we silently do
nothing. I will fix this in the development driver shortly. It won't
help your problem, though..

-O

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Ian Pilcher 2004-11-19 03:44:28 Re: Why IDENT doesn't work with JDBC
Previous Message Oliver Jowett 2004-11-19 02:10:10 Re: Why IDENT doesn't work with JDBC