Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lxrzf-0008En-P1 for pgsql-jdbc@arkaria.postgresql.org; Mon, 28 Jun 2021 14:12:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lxrze-0004wQ-La for pgsql-jdbc@arkaria.postgresql.org; Mon, 28 Jun 2021 14:12:10 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lxrze-0004w7-7J for pgsql-jdbc@lists.postgresql.org; Mon, 28 Jun 2021 14:12:10 +0000 Received: from mail.nqadmin.com ([12.230.133.169]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lxrzb-0003Fg-MX for pgsql-jdbc@lists.postgresql.org; Mon, 28 Jun 2021 14:12:09 +0000 Received: internal info suppressed Received: (from root@localhost) by mail.nqadmin.com (8.14.7/8.14.7/Submit) id 15SEC6sG000892; Mon, 28 Jun 2021 09:12:06 -0500 Received: from ppasalalinux.nqadmin.com (ppasalalinux.nqadmin.com [192.168.0.234]) by mail.nqadmin.com with SMTP id x6g7298ttc7mxmr7x6ppaujq42; Mon, 28 Jun 2021 09:12:05 -0500 (CDT) (envelope-from dbadmin@pangburngroup.com) Reply-To: dbadmin@pangburngroup.com Subject: Re: Exception while updating result set To: Dave Cramer Cc: pgsql-jdbc@lists.postgresql.org References: <472e572d-d1b9-63af-7a47-50c84dafe2ea@pangburngroup.com> <5bb2faf7-ab93-1e2e-6f30-7b7ed8e7418d@pangburngroup.com> <3a872c1c-5872-2083-87c9-39db27767828@pangburngroup.com> From: Prasanth Message-ID: Date: Mon, 28 Jun 2021 09:12:05 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------C7455E23A48F9BCC88BE1351" Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------C7455E23A48F9BCC88BE1351 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit https://github.com/pgjdbc/pgjdbc/issues/2194 Thanks, Prasanth On 6/26/21 5:49 AM, Dave Cramer wrote: > I can look at this Monday. Can you create an issue on github https://github.com/pgjdbc/pgjdbc > > Thx > > On Fri, Jun 25, 2021, 3:43 PM Prasanth > wrote: > > Sorry did not get the below email, just saw it in the website. Below is the sql. > > "SELECT * FROM accounting_periods where plan_id = 30756 order by start_date"; > > Thanks, > Prasanth > > On Thu, 25 Mar 2021 at 12:00, Prasanth 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 ? > > > From: Dave Cramer > To: dbadmin(at)pangburngroup(dot)com > Cc: pgsql-jdbc(at)lists(dot)postgresql(dot)org > Subject: Re: Exception while updating result set > Date: 2021-03-29 14:19:13 > Message-ID: CADK3HHK8WPCxbhoE4dTt=U0jpmtGWMT0okXY5oj5SAE1b7T26Q@mail.gmail.com > Views: Raw Message | Whole Thread > | Download mbox > | Resend email > > Lists: pgsql-jdbc > > > > On 3/25/21 11:00 AM, Prasanth 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 >> > --------------C7455E23A48F9BCC88BE1351 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit https://github.com/pgjdbc/pgjdbc/issues/2194

Thanks,
Prasanth

On 6/26/21 5:49 AM, Dave Cramer wrote:
I can look at this Monday. Can you create an issue on github https://github.com/pgjdbc/pgjdbc

Thx

On Fri, Jun 25, 2021, 3:43 PM Prasanth <dbadmin@pangburngroup.com> wrote:
Sorry did not get the below email, just saw it in the website. Below is the sql.

"SELECT * FROM accounting_periods where plan_id = 30756 order by start_date";

Thanks,
Prasanth

On Thu, 25 Mar 2021 at 12:00, Prasanth <dbadmin(at)pangburngroup(dot)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 ?


From: Dave Cramer <davecramer(at)postgres(dot)rocks>
To: dbadmin(at)pangburngroup(dot)com
Cc: pgsql-jdbc(at)lists(dot)postgresql(dot)org
Subject: Re: Exception while updating result set
Date: 2021-03-29 14:19:13
Message-ID: CADK3HHK8WPCxbhoE4dTt=U0jpmtGWMT0okXY5oj5SAE1b7T26Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc


On 3/25/21 11:00 AM, Prasanth 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



--------------C7455E23A48F9BCC88BE1351--