This content has been marked as final.
Show 3 replies
-
1. Re: Data not getting refreshed, how to disable cache?
sjmenden Oct 2, 2006 11:58 AM (in response to sjmenden)I also tried doing this:
query.setHint("org.hibernate.cacheable", new Boolean(false)); query.setHint("org.hibernate.cacheMode", CacheMode.IGNORE);
But I am still getting stale data, the only way to get the new data is to redeploy the webapp.
Please help. -
2. Re: Data not getting refreshed, how to disable cache?
sjmenden Oct 3, 2006 10:11 AM (in response to sjmenden)I even disabled second level cache to no avail? I am still getting stale data. Mysql command line is still reporting something different than what I am seeing in my view.
<persistence> <persistence-unit name="entityManager"> <provider>org.hibernate.ejb.HibernatePersistence</provider> <jta-data-source>java:/testDatasource</jta-data-source> <properties> <property name="hibernate.hbm2ddl.auto" value="create-drop"/> <property name="hibernate.show_sql" value="true"/> <property name="hibernate.format_sql" value="true" /> <property name="hibernate.cache.use_second_level_cache" value="false" /> <property name="jboss.entity.manager.factory.jndi.name" value="java:/testEntityManagerFactory"/> </properties> </persistence-unit> </persistence>
Help is greatly appreciated. -
3. Re: Data not getting refreshed, how to disable cache?
monkeyden Oct 3, 2006 1:29 PM (in response to sjmenden)IIRC, the second level cache is off by default. Also, I found this blog entry regarding Hibernate/EJB3 Tuning on the JBoss blog:
http://jboss.org/jbossBlog/blog/?month=1&day=23&year=2006
Here is a snippet:Note that the default flush mode (auto) in Hibernate flushes data whenever a query is executed or whenever a transaction is committed.
So configuring none of this should give you the desired result.