Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I store some entities that are not changed via Hibernate in Hibernate 2nd level cache. Also, I perform a lot of native SQL queries (updates) via Hibernate SessionFactory. Every time I execute native SQL query, second level cache is invalidated.

Here is good explanation of the behaviour. I can not go over the system and add sqlQuery.addSynchronizedQuerySpace("");

Is there any way to disable that behaviour? If I update cached entities using native SQL, it's my responsibility to invalidate 2nd level cache.

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.