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