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

Поиск
Список
Период
Сортировка
От Naoya Anzai
Тема A prepared statement ERROR due to EMPTY_QUERY is defined as a static Instance.
Дата
Msg-id 116262CF971C844FB6E793F8809B51C6B7D6BF@BPXM02GP.gisp.nec.co.jp
обсуждение исходный текст
Ответы Re: A prepared statement ERROR due to EMPTY_QUERY is defined as a static Instance.
Список pgsql-jdbc
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@mxu.nes.nec.co.jp
---



Вложения

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Artem Pronchakov
Дата:
Сообщение: Re: insert daterange field value
Следующее
От: Dave Cramer
Дата:
Сообщение: Re: A prepared statement ERROR due to EMPTY_QUERY is defined as a static Instance.