Re: A prepared statement ERROR due to EMPTY_QUERY is defined as a static Instance.

From: Dave Cramer <pg(at)fastcrypt(dot)com>
To: Naoya Anzai <anzai-naoya(at)mxu(dot)nes(dot)nec(dot)co(dot)jp>
Cc: "pgsql-jdbc(at)postgresql(dot)org" <pgsql-jdbc(at)postgresql(dot)org>, Akio Iwaasa <iwaasa(at)mxs(dot)nes(dot)nec(dot)co(dot)jp>
Subject: Re: A prepared statement ERROR due to EMPTY_QUERY is defined as a static Instance.
Date: 2014-03-10 23:21:15
Message-ID: CADK3HH+_x3FArJfZAfzfLyDqkpRXnZKDdcjS0ARgJ9hBdm=cfw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Naoya,

Thanks for the patch! Curious how would you ever come across this ?

Dave Cramer

dave.cramer(at)credativ(dot)ca
http://www.credativ.ca

On Thu, Mar 6, 2014 at 11:18 PM, Naoya Anzai
<anzai-naoya(at)mxu(dot)nes(dot)nec(dot)co(dot)jp>wrote:

> Hi All,
>
> I have found an odd movement when using multiple connections with
> prepareStatement("").
>
> The following ERROR message appeared.
>
> org.postgresql.util.PSQLException: ERROR: prepared statement "S_1" does
> not exist
>
> In org/postgresql/core/v3/QueryExecutorImpl.java,
> EMPTY_QUERY instance is defined as a static instance.
>
> ---
> private final static SimpleQuery EMPTY_QUERY = new SimpleQuery(new
> String[] { "" }, null);
> ---
>
> For that reason,
> After CONNECTION-A has prepared EMPTY_QUERY already,
> If CONNECTION-B tries to execute EMPTY_QUERY for the first time,
> then CONNECTION-B sends a bind message to PostgreSQL without prepare.
>
> I attached a sample source and a patch.
>
> Please confirm it.
>
> Best Regards,
>
> Naoya
>
> ---
> Naoya Anzai
> Engineering Department
> NEC Soft, Ltd.
> E-Mail: anzai-naoya(at)mxu(dot)nes(dot)nec(dot)co(dot)jp
> ---
>
>
>
>
> --
> Sent via pgsql-jdbc mailing list (pgsql-jdbc(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-jdbc
>
>

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Hannes Erven 2014-03-11 00:10:29 Concurrent use of isValid()
Previous Message Naoya Anzai 2014-03-07 04:18:56 A prepared statement ERROR due to EMPTY_QUERY is defined as a static Instance.