Couple of preparedstatement bug suspects

Поиск
Список
Период
Сортировка
От Roy Smith
Тема Couple of preparedstatement bug suspects
Дата
Msg-id 6a1128300805082054i2ca96b61xb8458b7a98fd7aca@mail.gmail.com
обсуждение исходный текст
Ответы Re: Couple of preparedstatement bug suspects  (Kris Jurka <books@ejurka.com>)
Список pgsql-jdbc
Hi All

I have an app which inserts rows to a table called messages. During load testing, I'm looping to insert 10,000 rows.
Intermittentently (around 5% and only after the first 6,000 or so) I'm getting the following Exception...

org.postgresql.util.PSQLException: This statement has been closed.
    at org.postgresql.jdbc2.AbstractJdbc2Statement.checkClosed(AbstractJdbc2Statement.java:2442)
    at org.postgresql.jdbc2.AbstractJdbc2Statement.getUpdateCount(AbstractJdbc2Statement.java:495)
    at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:309)
    at com.primetext.tl2000.dataobjects.Messages.insert(Messages.java:566)


This smells like a bug. There are other updates within my loop, and I can't promise that I'm closing all statements. Therefore if this bug is being triggered by me abusing the driver, please confirm and I'll go through all of my code ensuring that all preparedstatements are being closed.

However, there is a another aspect of this which smells like an even bigger bug...
Even though the PreparedStatement.executeUpdate is throwing an exception, the row *is* being written to the database!!
This can't possibly be valid.

best regards
Roy

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

Предыдущее
От: Kris Jurka
Дата:
Сообщение: Re: Correct getScale() behavior?
Следующее
От: Kris Jurka
Дата:
Сообщение: Re: Couple of preparedstatement bug suspects