Re: synchronized code - Mailing list pgsql-jdbc

From Michael Paesold
Subject Re: synchronized code
Date
Msg-id 01ec01c2b762$2b6013b0$3201a8c0@beeblebrox
Whole thread Raw
In response to synchronized code  (Felipe Schnack <felipes@ritterdosreis.br>)
List pgsql-jdbc
Felipe Schnack <felipes@ritterdosreis.br> wrote:

>   yuck! I think this implementation is kinda gross (can you send me this
> source? Just curious). Just imagine using preparedstatements, you will
> allocate a big internal buffer (to store the "PREPARE", etc command) and
> then just execute much smaller "EXECUTE" calls.

Well, I am really sorry, just re-read the code. I only fills the rest of the
StringBuffer with '\0' bytes, if the new length is _longer_ than the old. My
mistake. So setLength(0) is not expensive.
Btw. there is a src.zip in any j2sdk distribution that contains pretty much
all the java source code.

I would be very much interested in benchmarks with jdk 1.3, too.

Michael


pgsql-jdbc by date:

Previous
From: Oliver Jowett
Date:
Subject: Re: synchronized code
Next
From: Joseph Shraibman
Date:
Subject: Character Encoding WAS: ArrayIndexOutOfBoundsException in Encoding.decodeUTF8()