pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Hédi HACHENI <hacheni@kopileft.com>
To: Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
Cc: List <pgsql-jdbc@postgresql.org>
Subject: Re: JDBC and positioned updates
Date: Sat, 26 Dec 2015 09:01:01 +0100
Message-ID: <567E493D.7050204@kopileft.com> (raw)
In-Reply-To: <CAB=Je-F-j-XY6yZCZtcByWkRL+saNJ7rMZXuRovYtp2cP33XqA@mail.gmail.com>
References: <567D5C7B.3060402@kopileft.com>
	<CAB=Je-F-j-XY6yZCZtcByWkRL+saNJ7rMZXuRovYtp2cP33XqA@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-jdbc>

Hi,

We cannot use the updatable result set technique since we support 
multiple databases so we want to use the AINSI syntax with the CURRENT 
OF cursor_name.

We tried to implement the java.sql.Statement#*setCursorName*(String) and 
the java.sql.ResultSet#*getCursorName*() methods so that we can set the 
cursor name of an SQL statement. But, it seems to be more complicated 
than that we expected since the database server always says *"cursor 
"name" does not exist**"

*What we did is to change a little bit the implementation of the 
*org.postgresql.core.v3.QueryExecutorImpl *in a way that we can define a 
cursor name for an SQL statement. We tried to inject this in the 
*org.postgresql.core.v3.Portal *class but we did not succeed.

Any ideas ?

Best regards

On 12/25/2015 04:38 PM, Vladimir Sitnikov wrote:
> 1) Have you considered using "updatable ResultSet"?
>
> Here's a sample:
> https://github.com/pgjdbc/pgjdbc/blob/32f513370306529005cb36d968f8e415f4a88aec/pgjdbc/src/test/java/...
>
> 2) >   WHERE CURRENT OF cursor_name
>
> ResultSet implementation fetches result rows in batches, thus "current
> of" at the database side might point to a slightly different row than
> ResultSet at the java side.
>
> 3) You do not expect high throughput of that kind of API, do you?
> Updatable ResultSet is not using batching, so each update would result
> in a database roundtrip.
>
> Vladimir

view thread (8+ messages)  latest in thread

Message-ID: <567E493D.7050204@kopileft.com>
Permalink:  ../567E493D.7050204@kopileft.com/
Also on:    postgresql.org/message-id/567E493D.7050204@kopileft.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: hacheni@kopileft.com, sitnikov.vladimir@gmail.com
  Subject: Re: JDBC and positioned updates
  In-Reply-To: <567E493D.7050204@kopileft.com>
  References: <567D5C7B.3060402@kopileft.com> <CAB=Je-F-j-XY6yZCZtcByWkRL+saNJ7rMZXuRovYtp2cP33XqA@mail.gmail.com> <567E493D.7050204@kopileft.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox