Regular |
|
Joined: Thu Apr 21, 2005 9:05 am Posts: 50 Location: Boston, U.S
|
In our project we have been considering using Hibernate and Tangosol.
While i was doing my Proof of Concept, i realized that only Session.get()
requests are cached and where as in createquery request the data is not
cached.
For Instance i have made two get calls on session
session.get(xxx.class, new Integer(10));
session.get(xxx.class, new Integer(10));
In the above case only one SQL is executed and during the second
time it reads from the cache.
But if use twice
session.createQuery(" from xxx a where a.col1='10' ").list();
session.createQuery(" from xxx a where a.col1='10' ").list();
Two sql queries are getting triggered and the data does not
seem to be cached.
Any thoughts or suggestions are most welcome.
Regards
Hibernate version:
3.0.1
Mapping documents:
<!-- Second-level Cache -->
<property name="hibernate.cache.region_prefix">repl-</property>
<property name="hibernate.cache.use_second_level_cache">true</property>
<property name="hibernate.cache.use_structured_entries">true</property>
<property name="hibernate.cache.use_query_cache">true</property>
<property name="hibernate.cache.provider_class">CoherenceCacheProvider</property>
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Name and version of the database you are using:
Oracle 10g
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
|
|