Re: JDBC: ERROR: portal "C_2" does not exist

From: Blake McBride <blake1024(at)gmail(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: Sehrope Sarkuni <sehrope(at)jackdb(dot)com>, pgsql-jdbc(at)lists(dot)postgresql(dot)org
Subject: Re: JDBC: ERROR: portal "C_2" does not exist
Date: 2022-04-13 14:53:06
Message-ID: CABwHSOtqiJUS4Aby4UY5snBS9g-cm6=Sgn5qRj_e3v1=F-5NsQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Not sure if anyone is interested, however, I found and corrected a bug in
the caching routines described below having to do with binary data.

--blake

On Sun, Mar 13, 2022 at 2:39 PM Blake McBride <blake1024(at)gmail(dot)com> wrote:

> Thanks, David.
>
> I found a way around the problem (without needing another connection) by
> locally caching and closing result sets thus no result set is ever pending
> when another takes place. It intelligently caches the data in-memory or in
> a temporary file. The code is at
> https://github.com/blakemcbride/Kiss/tree/master/src/main/core/org/kissweb/database
> if anyone is interested. The actual caching occurs in
> Cursor.cacheAllRecords() and Cursor.nextCachedRecord().
>
> Thanks!
>
> Blake McBride
>
>
>
>
> On Fri, Mar 11, 2022 at 11:16 PM David G. Johnston <
> david(dot)g(dot)johnston(at)gmail(dot)com> wrote:
> >
> > On Fri, Mar 11, 2022 at 8:47 PM Blake McBride <blake1024(at)gmail(dot)com>
> wrote:
> >>
> >>
> >> conn.setAutoCommit(false)
> >> PreparedStatement pstat = conn.prepareStatement(sql)
> >> pstat.setFetchSize(50)
> >> select all records in a large file
> >> for each record:
> >> read one field from the record
> >> through a second statement, add a record to a different table -
> XXX
> >> execute the second statement - YYY
> >> commit the change - ZZZ
> >> loop
> >>
> >> It seems I can do one or the other but not both - or can I?
> >>
> >
> > Correct. What you are trying to do requires that you open two sessions
> to the database (conn_read, conn_write) and execute the INSERT command on
> the conn_write connection while looping through data on the conn_read one.
> >
> > David J.
> >
>

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Dave Cramer 2022-04-15 12:42:55 [pgjdbc/pgjdbc] 09c2c3: remove loggerLevel and loggerFile from docs and is...
Previous Message Mukhin, Dmitriy 2022-04-06 23:00:41 Re: Revive targetServerType=preferPrimary feature