Hi guys,
As I understand it, in Hibernate I can:
- create Queries, which are reuseable but not threadsafe
- create NamedQueries, which are threadsafe but not creatable at runtime
Is there a third option? Any way to dynamically create, then cache and reuse, a Query without the performance hit of having to synchronize access to it?
Something like...
Code:
session.registerNamedQuery( "myQuery", "select a from Staff" )
I'd like to avoid the performance hit of recompiling commonly-executed queries, even when those queries aren't known in advance.
Regards,
Richard.