Register / Login
Object Relational Mapping
Clear session in hibernate with spring
posted 7 years ago
Apologies if the problem has already been discussed.
I'm refering to this thread:
We are using Spring Framework 2.5 and Hibernate 3.3.1, using hibernateTemplate.
We are wondering if we use the appropriate way to clear the session cache when executing a query in a loop, so thanks for any suggestion.
The problem is the following: the details records are configured to be eagerly fetched. But when querying the master records in a loop, the details are cached - which is undesirable.
Clearing the session at the end of the query (session.clear()) solves this caching problem ... but is there a better way ?
Thanks for any input
Cheers - Nicolas Stern
Insert new records in database without deleting existing records
CacheFullException - can I "free" beans?
Is there a default cache?