Re: Is it thread-safe to pool the PreparedStatement?
Ted Neward <[email protected]>
| Newsgroups | gmane.comp.windows.devel.java.advanced |
|---|---|
| Message-ID | <078b01c7e47a$4cc217c0$e6464740$@net> |
Put the whole data-interaction thing behind an Executor, then you can tune when and how the database calls are made to your hearts' content--one thread across the entire app, one thread per call, bound set of threads.... Ted Neward Java, .NET, XML Services Consulting, Teaching, Speaking, Writing http://www.tedneward.com > -----Original Message----- > From: Discussion of advanced Java topics. [mailto:ADVANCED- > [email protected]] On Behalf Of Carfield Yim > Sent: Tuesday, August 21, 2007 7:44 AM > To: [email protected] > Subject: Re: [ADVANCED-JAVA] Is it thread-safe to pool the > PreparedStatement? > > > concurrently since you could have thread A calling setString(1, "a") > and > > thread B calling setString(1, "b") on the same prepared statement and > > That is what in my mind also, but in fact the application look run > fine at this moment. > > > http://www.javaperformancetuning.com/tips/jdbc_prepared.shtml for > > details. > > > Thanks for the information > > =================================== > This list is hosted by DevelopMentor http://www.develop.com > > View archives and manage your subscription(s) at > http://discuss.develop.com > > No virus found in this incoming message. > Checked by AVG Free Edition. > Version: 7.5.484 / Virus Database: 269.12.1/965 - Release Date: > 8/21/2007 4:02 PM > No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.484 / Virus Database: 269.12.1/965 - Release Date: 8/21/2007 4:02 PM =================================== This list is hosted by DevelopMentor® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com