Hello,
I am using Hibernate 3.2.3 with JPA. I have a question about using L2 cache. The only way I can get the L2 cache to work is to use EntityManager.find() which requires an entity class and a primary key. However this method does not fit into something that I want to accomplish.
There are several small tables that I want them to be cached once they are queried for the first time. To accomplish this goal, I use EntityManager.createQuery("select e from EntityClass e"). The idea is to run this query once at server startup time so that these small tables are cached. But the observation is that every time this query is ran, Hibernate opens a JDBC connection. The debug message says these entries are cached but then the next run triggers another JDBC connection.
Simon[/quote]
|