Re: patch: tiny patch to correct stringbuffer size estimate - Mailing list pgsql-jdbc

From Felipe Schnack
Subject Re: patch: tiny patch to correct stringbuffer size estimate
Date
Msg-id 20030722120545.134ebe3a.felipes@ritterdosreis.br
Whole thread Raw
In response to Re: patch: tiny patch to correct stringbuffer size estimate  (Oliver Jowett <oliver@opencloud.com>)
List pgsql-jdbc
  Am I wrong or the jdbc spec say they should be thread-safe?

On Wed, 23 Jul 2003 02:28:07 +1200
Oliver Jowett <oliver@opencloud.com> wrote:

> On Tue, Jul 22, 2003 at 11:20:11AM -0300, Felipe Schnack wrote:
>
> >   These StringBuffer woes remember of an old request we made to this
> >   list... The last time I checked driver's sources, all acess to
> >   preparedstatement's stringbuffer are synchronized... this isn't
> >   necessary as jre's Stringbuffer already has all of its methods
> >   synchronized. The driver is still doing that? Just curious.
>
> Yes, but to be threadsafe with a shared buffer you do need to synchronize as
> the driver does a series of operations to accumulate a string that need to
> be atomic. Synchronizing on each individual operation isn't enough.
>
> That said, it's pretty silly to write code that depends on a Statement being
> threadsafe :)
>
> -O


--

 /~\ The ASCII        Felipe Schnack (felipes@ritterdosreis.br)
 \ / Ribbon Campaign  Analista de Sistemas
  X  Against HTML     Cel.: 51-91287530
 / \ Email!           Linux Counter #281893

Centro Universitário Ritter dos Reis
http://www.ritterdosreis.br
ritter@ritterdosreis.br
Fone: 51-32303341

pgsql-jdbc by date:

Previous
From: Fernando Nasser
Date:
Subject: Re: the IN clause saga
Next
From: Oliver Jowett
Date:
Subject: Re: the IN clause saga