I have a sleeping request (hibernate 3) that only reads data from a database. The database is updated by a separate application, and the query result does not reflect changes in the database.
With a bit of research, I think this might have something to do with the Hibernate L2 cache (I don't think this is the L1 cache, since I always open a new session and close it after it ends).
Session session = sessionFactoryWrapper.getSession();
List<FlowCount> result = session.createSQLQuery(flowCountSQL).list();
session.close();
I tried disabling the second level cache in the hibernate configuration file, but it does not work:
<property name="hibernate.cache.use_second_level_cache">false</property>
<property name="hibernate.cache.use_query_cache">false</property>
<propertyname="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
I also added session.setCacheMode(CacheMode.Refresh);after Session session = sessionFactoryWrapper.getSession();to force update L1 cache, but still not working ...
Is there any other way to get the changes to the database? Am I doing something wrong how to disable the cache? Thank.
Update:
, :
- . . .
- . . MySql Workbench. , .
- . .
, , , - ...