Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refresh row causes current row to be readonly #2193

Closed
davecramer opened this issue Jun 28, 2021 · 1 comment
Closed

Refresh row causes current row to be readonly #2193

davecramer opened this issue Jun 28, 2021 · 1 comment

Comments

@davecramer
Copy link
Member

This was reported on the list

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

@davecramer
Copy link
Member Author

closed by #2195

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant