Re: Exception while updating result set

Поиск
Список
Период
Сортировка
От Dave Cramer
Тема Re: Exception while updating result set
Дата
Msg-id CADK3HHK8WPCxbhoE4dTt=U0jpmtGWMT0okXY5oj5SAE1b7T26Q@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Exception while updating result set  (Prasanth <dbadmin@pangburngroup.com>)
Список pgsql-jdbc


On Thu, 25 Mar 2021 at 12:00, Prasanth <dbadmin@pangburngroup.com> wrote:
Hi,

Does anyone have any thoughts on this?

Thanks,
Prasanth

On 3/18/21 5:20 PM, Prasanth wrote:
Hi,

The following code generates an exception shown below. Commenting out the refreshRow() call would solve the issue. This exception happens only in driver versions 42.2.13 and above. Is this a bug in the driver?

        ResultSet rs = connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE ).executeQuery(sql);
        rs.next();
        rs.updateDate("start_date", Date.valueOf("2020-01-01"));
        rs.updateDate("end_date", Date.valueOf("2020-12-31"));
        rs.updateRow();
        rs.refreshRow();
        rs.updateDate("end_date", Date.valueOf("2020-12-30"));
        rs.updateRow(); // Exception occurs at this line.


Exception in thread "main" java.lang.IllegalArgumentException: Attempted to write to readonly tuple
    at org.postgresql.core.Tuple.set(Tuple.java:96)
    at org.postgresql.jdbc.PgResultSet.setRowBufferColumn(PgResultSet.java:1680)
    at org.postgresql.jdbc.PgResultSet.updateRowBuffer(PgResultSet.java:1733)
    at org.postgresql.jdbc.PgResultSet.updateRow(PgResultSet.java:1378)

Thanks,
Prasanth


What is the query ? 

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: plan3d
Дата:
Сообщение: [pgjdbc/pgjdbc] c633cc: Fixed indentation of BlobTest.java (#2107)
Следующее
От: Dave Cramer
Дата:
Сообщение: Re: Bug regarding PostgreSQL JDBC driver truncating microseconds to milliseconds