Re: non-trivial finalize() on AbstractJdbc2Statement

Поиск
Список
Период
Сортировка
От Kevin Grittner
Тема Re: non-trivial finalize() on AbstractJdbc2Statement
Дата
Msg-id 4F38EAC5020000250004545C@gw.wicourts.gov
обсуждение исходный текст
Ответ на Re: non-trivial finalize() on AbstractJdbc2Statement  (Віталій Тимчишин <tivv00@gmail.com>)
Ответы Re: non-trivial finalize() on AbstractJdbc2Statement
Список pgsql-jdbc
******* ********<tivv00@gmail.com> wrote:
> Looking at the code... Can it be because
> org.postgresql.jdbc2.AbstractJdbc2Statement#isClosed is not
> volatile? There is no synchronization and finalizer thread may
> simply not see statement was just closed by another thread.

That sounds likely enough to me.  I don't know whether declaring the
flag volatile would be enough, but it needs either that or access
only through synchronized blocks.

In addition, I would recommend something like the attached to make
the code more bullet-proof.

-Kevin


Вложения

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

Предыдущее
От: Віталій Тимчишин
Дата:
Сообщение: Re: non-trivial finalize() on AbstractJdbc2Statement
Следующее
От: Dave Cramer
Дата:
Сообщение: Re: bug on to do list reproducable at version 9.0-801