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 D6A0F5E46EC for ; Thu, 26 Aug 2004 15:08:21 -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 59306-02 for ; Thu, 26 Aug 2004 18:08:18 +0000 (GMT) Received: from net2.micro-automation.com (net2.micro-automation.com [64.7.141.29]) by svr1.postgresql.org (Postfix) with SMTP id E96EA5E40BA for ; Thu, 26 Aug 2004 15:08:17 -0300 (ADT) Received: (qmail 25906 invoked from network); 26 Aug 2004 18:08:15 -0000 Received: from dcdsl.ebox.com (HELO ?192.168.1.36?) (davec@64.7.143.116) by net2.micro-automation.com with SMTP; 26 Aug 2004 18:08:15 -0000 Subject: Re: Race condition in From: Dave Cramer Reply-To: pg@fastcrypt.com To: jao@geophile.com Cc: "pgsql-jdbc@postgresql.org" In-Reply-To: <1093541258.412e1d8ae5989@geophile.com> References: <1093541258.412e1d8ae5989@geophile.com> Content-Type: text/plain Organization: Cramer Consulting Message-Id: <1093543794.5994.55.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Thu, 26 Aug 2004 14:09:54 -0400 Content-Transfer-Encoding: 7bit X-AntiVirus: scanned for viruses by AMaViS 0.2.1 (http://amavis.org/) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200408/147 X-Sequence-Number: 10869 This code has been removed from the current CVS head. Which version of the code are you looking at ? Dave On Thu, 2004-08-26 at 13:27, jao@geophile.com wrote: > 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. > > ---------------------------(end of broadcast)--------------------------- > TIP 2: you can get off all lists at once with the unregister command > (send "unregister YourEmailAddressHere" to majordomo@postgresql.org) > -- Dave Cramer 519 939 0336 ICQ # 14675561 www.postgresintl.com