users@glassfish.java.net

PreparedStatement Caching

From: Mei Wu <Mei.Wu_at_Sun.COM>
Date: Fri, 22 Feb 2008 10:46:48 -0500

Does Glassfish datasource have PreparedStatement Caching in connection pool?
I mean data source optimizes the processing of prepared statements by
managing a pool of database connections, as well as an associated cache
of prepared statement objects. Prepared statements are cached separately
for each connection that executes them.

 From my test using oracle, if I do normally like create a connection,
does PreparedStatement, commit connection, close PreparedStatement and
close connection, the throughput is 30% lower than if I cache the the
connection and PreparedStatement in the application itself and use it in
multiple transactions, which I don't think is a recommended practice
while using the connection pooling in app server.

Thanks
Mei