Which pool/version are you using? Also how are you configuring the pool? You want to make sure your library is wrapping the connection or if not; is interfacing with the pooled connection/data source object.
On Tuesday 04 March 2008 22:36:17 Narayanan wrote:The underlying problem must be something to do with Connection reuse. We
> I have tried getting a blob from a result set and tried the length()
> method on it after the following Scenarios
> 1) Closing the connection
discovered that am.PreparedStatement.parameterMetaData_ was being set to null
in markClosed(), and yet the same PreparedStatement object was being reused
for subsequent blob length queries. So it would work once and then not for
any subsequent attempts. Subsequent attempts for the same blob would
probably work because the result is cached elsewhere but attempts for a
different blob would use the same cached, invalid PreparedStatement object.
Here's who's setting it to null:
We're calling Connection.close() but it's a connection from a pool, and you're
supposed to close those.
- Don't set things to null during close methods (it's inherently dangerous.)
- Check if the statement is closed after checking whether it's null
(possibly defeats the purpose of caching the statement for the connection.)
Anyway now that we know roughly where the problem is, some Derby developer
will presumably know better than us how to fix it without breaking anything