Re: Race condition in

From: Dave Cramer <pg(at)fastcrypt(dot)com>
To: jao(at)geophile(dot)com
Cc: "pgsql-jdbc(at)postgresql(dot)org" <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Race condition in
Date: 2004-08-26 18:09:54
Message-ID: 1093543794.5994.55.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

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(at)geophile(dot)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(at)postgresql(dot)org)
>
--
Dave Cramer
519 939 0336
ICQ # 14675561
www.postgresintl.com

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message jao 2004-08-26 18:31:13 Re: Race condition in org.postgresql.jdbc1.AbstractJdbc1Statement?
Previous Message jao 2004-08-26 17:27:38 Race condition in org.postgresql.jdbc1.AbstractJdbc1Statement?