There was a global Prepared Statement cache in version 1.8. This was too
complex as it had to keep track of closed sessions and statements
closing on some sessions and not on others. The cache was moved to
individual sessions in version 2.0.
You can use a connection pool. There are two options. The
org.hsqldb.jdbc.JDBCPool or a generic JDBC pool.
The org.hsqldb.Session class has a resetSession() method that calls
statementManager.reset(). The JDBCPool calls the resetSession() method.
Therefore you need to modify either class to not reset the
StatementManager. Third party pools may or may not be resetting the
HSQLDB session upon reuse, so you need to check.
Fred Toussi
On Thu, May 26, 2016, at 19:41, Daniel Walsh wrote:
> Hi Devs,
>
> I have a question I couldn't find an answer for online or by
> investigating the HSQLDB code myself.
>
> Is there a reason currently in the implementation that the Stateless
> aspect of a Prepared Statement when compiled isn't stored in a global
> non-connection level cache ?
>
> I have a use case where connections are created and destroyed
> regularly and each connection calls 100+ prepared statement creation
> and executions during its lifecycle, in a test case that encompasses
> many other factors I increased performances by creating a naive low
> level cache of the compiled statement to be used each time a new
> PreparedStatement with a matching sql string was created.
>
> This had a massive benefit to performance because the statements being
> compiled are quite complex.
>
> Is this a feature that hasn't been implemented on purpose ? Or just an
> open gap ?
>
> Thanks,
> Daniel Walsh
> Software Dev
> ----------------------------------------------------------------------
> --------
> Mobile security can be enabling, not merely restricting. Employees who
> bring their own devices (BYOD) to work are irked by the
> imposition of MDM
> restrictions. Mobile Device Manager Plus allows you to control
> only the
> apps on BYO-devices by containerizing them, leaving personal data
> untouched!
> https://ad.doubleclick.net/ddm/clk/304595813;131938128;j[1]
> _________________________________________________
> hsqldb-developers mailing list
> hsqldb-developers@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/hsqldb-developers
Links:
1. https://ad.doubleclick.net/ddm/clk/304595813%3B131938128%3Bj
------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
hsqldb-developers mailing list
hsqldb-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hsqldb-developers