Skip site navigation (1) Skip section navigation (2)

Re: non-trivial finalize() on AbstractJdbc2Statement

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Imran" <imranbohoran(at)gmail(dot)com>, ******* ******** <tivv00(at)gmail(dot)com>
Cc: "Dave Cramer" <pg(at)fastcrypt(dot)com>,<pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: non-trivial finalize() on AbstractJdbc2Statement
Date: 2012-02-13 16:49:41
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-jdbc
******* ********<tivv00(at)gmail(dot)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.

Attachment: finalizer-v1.diff
Description: application/octet-stream (1.6 KB)

In response to


pgsql-jdbc by date

Next:From: Bodor AndrásDate: 2012-02-13 17:03:44
Subject: Re: bug on to do list reproducable at version 9.0-801
Previous:From: Віталій ТимчишинDate: 2012-02-13 15:23:10
Subject: Re: non-trivial finalize() on AbstractJdbc2Statement

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group