Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hi,
Im trying to use the QueryCache for tuning my queries.
Now when I activate read-write cache on all my Business Objects, and on all collections (all set lazy="true") for those business objects, and I then perform a Query all is cached as it should be.
The following is the extract of such a collection.
<bag name="functies" inverse="false" lazy="true" cascade="save-update">
<cache usage="read-write"/>
<key column="MDW_ID" property-ref="medewerkerId" />
<one-to-many class="Functie" />
</bag>
However when I Query again, and want to fetch the "functies" associations I got a
org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: be.ikmo.core.model.Medewerker.functies - no session or session was closed
exception.
When I look deeper into the code, all data is retrieved the second time, but it fails to take a TypeFactory.deepCopy() as the updateability for the collections has a "false" value instead of a "true" as all other properties have.
I've been looking where I can define this Updateability on those collection, but was not able to find it.
Is there anybody who can help me out.
Thnx,
Nico
Hibernate version:3.05
Mapping documents:
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Name and version of the database you are using:
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt: