lazy « Cache « JPA Q&A





1. hibernate second level cache and lazy initialized collection    forum.hibernate.org

Hi all Here's my problem. I'm working with a 2nd level cache (EhCache) on a web application with an openSessionInView Spring filter. Everything worked fine so far until i activated the 2nd level cache (new feature). But now i see in the logs of my application that i have some LazyInitializationException : Code: org.hibernate.LazyInitializationException: failed to lazily initialize a collection of ...

2. Hibernate second level cache and lazy assocations question    forum.hibernate.org

Can anyone provide any assistance with the second level cache in hibernate. I am relatively new to this area and I am experiencing some unexpected behaviour. I am using JBoss AS 5.01 with JBoss cache as follows: Code: ... Before I go any further I know the second level cache and query ...

3. Learnings and questions PersistenceContextType, cache, lazy    forum.hibernate.org

When we use PersistenceContextType.TRANSACTION changes we make to a disconnected entity wont be visible if we again obtain the entity using its id and these changes will be lost if we update the freshly gotten same entity and save it. This is because the freshly gotten entity is got by executing a select. Further more if lazy fields had not been ...

4. Session.get() in combination whith cache and lazy="fals    forum.hibernate.org

Session.get() in combination whith cache and lazy="false" broken??? I have trouble with Session.get() which is supposed to always return a non-proxied instance. Well it does not. Not even when using lazy="true". I also have caching enabled for the class. I have narrowed it down to the class org.hibernate.event.def.DefaultLoadEventListener in the method proxyOrLoad (at around row number 227) I actualy get a ...

5. Problem with lazy=false and second level cache.    forum.hibernate.org

Newbie Joined: Fri Mar 24, 2006 1:20 pm Posts: 7 Hello, I dont understand how second-level cache works with lazy=false. I have a Media class with a many-to-many relation ("tags") to the Tag class : - Media is second-level cached - Tag is second-level cached - the many-to-many relation from media to tag is second-level cached. - the many-to-many relation from ...

6. how do I use ehcache in JPA with Lazy collections?    forum.hibernate.org

Hello All, How can I cache a query for an object with children that are lazily fetched? I am defining the collection as LAZY fetch and retrieving the children via a "left join fetch" in the query. When I set hibernate.cache.use_query_cache to false, everything works great. When I enable ehcache, it works the first time, but the 2nd time I load ...