My application uses Derby 10.1 in a derby client that is a servlet running within a Servlet Container (typically Sun Java Application Srever 8.2 a.k.a AS or Tomcat 5.0.x).

We use PreparedStatement quite a bit. I would like to know what we can do to maximize reuse of PreparedStatement optimization plan within Derby.
Whose job is it to do PreparedStatement pooling?
Is is Derby's or the container (AS / Tomcat)?
What can we do do maximize leverage of PreparedStatement caching in my configurations?

BTW We do not typically close our PreparedStatement basedon the possibly faulty assumption that this would remove the PreparedStatement form the PreparedStatement cache. We instead rely on Connection.close() to take care of doing whatever closing is
needed to be done. Is this a bad practice?

Above practice has led us into trouble with the following known Derby issue:

http://issues.apache.org/jira/browse/DERBY-210

It seems the workaround is to close all PreparedStatements explicitly.

If we do that will it remove PreparedStatement that is being closed from the PreparedStatement cache?

Thanks for any guidance on this.

--
Regards,
Farrukh


begin:vcard
fn:Farrukh Najmi
n:Najmi;Farrukh
email;internet:[EMAIL PROTECTED]
tel;work:781-442-9017
url:http://ebxmlrr.sourceforge.net/tmp/farrukhRacePointIcon.jpg
version:2.1
end:vcard

Reply via email to