Hibernate version: 3.2
BEA WebLogic: 8.15
Just a simple query, and yes I have tried all possible solutions. I simply want to make sure that Hibernate does not load/persist data in cache, rather it should hit the database everytime.
This is what I have done so far:
1) Hibernate configuration:
<property name="query.factory_class">
org.hibernate.hql.classic.ClassicQueryTranslatorFactory
</property>
<property name="hibernate.cache.use_query_cache">
false
</property>
<property name="hibernate.cache.use_second_level_cache">
false
</property>
2) All one-many relations (sets) have cascade="save-update" and lazy="false"
3) The DAO
session.setCacheMode(CacheMode.IGNORE);
session.setFlushMode(FlushMode.COMMIT);
4) Service layer:
AbstractDAO.save(object);
AbstractDAO.commit(transaction);
AbstractDAO.flush();
So is there still something that I am missing? I have been working in hibernate for 2 years but never ever have seen this behavior where it does not store data in db, but the data is available for view. I would really appreciate any help, otherwise I will only be left with switching to plain old JDBC and that does not look good :(. Thanks.
_________________ --
Regards,
Adeel Javed,
Software Engineer,
Techlogix Pakistan (Pvt) Limited.
Web: http://pkblogs.com/adeeljaved
|