X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id E63575E40BA for ; Thu, 26 Aug 2004 14:27:52 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 43705-05 for ; Thu, 26 Aug 2004 17:27:49 +0000 (GMT) Received: from black.geophile.com (h004005242b8e.ne.client2.attbi.com [24.91.49.146]) by svr1.postgresql.org (Postfix) with ESMTP id AC9695E37D0 for ; Thu, 26 Aug 2004 14:27:48 -0300 (ADT) Received: from black.geophile.com (localhost.localdomain [127.0.0.1]) by black.geophile.com (8.12.8/8.12.8) with ESMTP id i7QHRdXq006856 for ; Thu, 26 Aug 2004 13:27:39 -0400 Received: (from apache@localhost) by black.geophile.com (8.12.8/8.12.8/Submit) id i7QHRdS3006854 for pgsql-jdbc@postgresql.org; Thu, 26 Aug 2004 13:27:39 -0400 X-Authentication-Warning: black.geophile.com: apache set sender to jao@geophile.com using -f Received: from 64.119.142.34 ([64.119.142.34]) by geophile.com (IMP) with HTTP for ; Thu, 26 Aug 2004 13:27:38 -0400 Message-ID: <1093541258.412e1d8ae5989@geophile.com> Date: Thu, 26 Aug 2004 13:27:38 -0400 From: jao@geophile.com To: pgsql-jdbc@postgresql.org Subject: Race condition in org.postgresql.jdbc1.AbstractJdbc1Statement? MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit User-Agent: Internet Messaging Program (IMP) 3.2.2 X-Originating-IP: 64.119.142.34 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.3 tagged_above=0.0 required=5.0 tests=NO_REAL_NAME X-Spam-Level: X-Archive-Number: 200408/146 X-Sequence-Number: 10868 Cursor and statement names include the value of m_preparedCount: m_statementName = "JDBC_STATEMENT_" + m_preparedCount++; and m_cursorName = "JDBC_CURS_" + m_preparedCount++; m_preparedCount is static, and it looks like m_preparedCount++ should be synchronized: // m_preparedCount is used for naming of auto-cursors and must // be synchronized so that multiple threads using the same // connection don't stomp over each others cursors. private static int m_preparedCount = 1; private synchronized static int next_preparedCount() { return m_preparedCount++; } But next_preparedCount() is not used. Should the creation of statement and cursor names use next_preparedCount() instead of using m_preparedCount directly? Jack Orenstein ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program.