Re: Is it thread-safe to pool the PreparedStatement?
Bob Lee <[email protected]>
| Newsgroups | gmane.comp.windows.devel.java.advanced |
|---|---|
| Message-ID | <[email protected]> |
Your connection pool should already pool PreparedStatements for you. If not, the proper way to pool these is on a connection by connection basis (i.e. a PreparedStatement pool per connection). You should only access a given connection from one thread at a time. Bob On 8/20/07, Carfield Yim <[email protected]> wrote: > > I just join a project, this existing team member of this project > concern performance a lot so their pool all PreparedStatements into a > map (probably not a nice optimization, but I have no say about that) > when the application start. And then reuse those preparedstatement > again and again. > > I haven't get time to check all method call using those > preparedstatement are synchronized properly. If that is not the case, > is it thread-safe to pool the PreparedStatement? > > =================================== > This list is hosted by DevelopMentor(r) http://www.develop.com > > View archives and manage your subscription(s) at > http://discuss.develop.com > =================================== This list is hosted by DevelopMentor® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com