On 22/07/2003 17:36 Felipe Schnack wrote:
> Looking at this case I don't think they are unnecessary. But I would
> like to just raise some questions for clarification
> - The JDBC spec doesn't say these objects should be used in a
> thread-safe way? What I mean: your application/container shouldn't use a
> single PreparedStatement in multiple threads)... I think I saw this
> somewhere, but I might be wrong
> - Maybe the unnecessary synch'ing is the one stringbuffer does
> internally?
>
Some databases might not even like sharing a connection between threads (I
know is is true for ODBC implemenations) so best practice would never see
synch'ing to be neccessary. OTOH, synchronization does not cause much of a
performance hit on modern JVMs (according to developer works).
--
Paul Thomas
+------------------------------+---------------------------------------------+
| Thomas Micro Systems Limited | Software Solutions for the Smaller
Business |
| Computer Consultants |
http://www.thomas-micro-systems-ltd.co.uk |
+------------------------------+---------------------------------------------+