Re: PSQLException: Too many update results were returned.

Поиск
Список
Период
Сортировка
От Oliver Jowett
Тема Re: PSQLException: Too many update results were returned.
Дата
Msg-id 46B3CF4F.4020705@opencloud.com
обсуждение исходный текст
Ответ на PSQLException: Too many update results were returned.  (Albert Laszlo-Robert <albert_laszlorobert@yahoo.com>)
Ответы Re: PSQLException: Too many update results were returned.
Re: PSQLException: Too many update results were returned.
Список pgsql-jdbc
Albert László-Róbert wrote:

> yes, the statements are semicolon-separated. than you have some idea how
> to make it to work?

Try adding only one statement per addBatch() i.e. instead of

   stmt.addBatch("insert a; insert b; insert c");

do:

   stmt.addBatch("insert a");
   stmt.addBatch("insert b");
   stmt.addBatch("insert c");

> note: if i use a simple executeUpdate for multiple inserts that are
> semicolon-separated, than they work.

Yes, executeUpdate is a different code path that does understand
semicolon-separated paths.

The batch code expects exactly one command status per addBatch(). It's
not clear from the JDBC API what you're meant to do with an addBatch()
call that returns more than one thing, since executeBatch() is meant to
return one array element (representing the update status) per addBatch()
call AFAIK.

-O

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

Предыдущее
От: Albert László-Róbert
Дата:
Сообщение: Re: PSQLException: Too many update results were returned.
Следующее
От: Oliver Jowett
Дата:
Сообщение: Re: PSQLException: Too many update results were returned.