******* ********<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