cache « Field « JPA Q&A





1. Why is my transient field null after getting object out of 2nd level cache?    stackoverflow.com

I have a class that is using reflection and has a reference to a Field object. Clearly, I am not going to persist Field, so I marked it as @Transient, acknowledging ...

2. Hibernate entity caching on a field other than the id    stackoverflow.com

I have an entity with a dataless primary key (@Id) and an attribute that is unique, but meaningful (stockTicker). Clients of this entity sometimes request results by the @Id criteria ...

3. cache and lazy fields    forum.hibernate.org

I have already asked this question, but I got no answers, I'll try to rephrase it: I have entity Employee that is associated to Department by ManyToOne lazy association. I use custom query with explicit join to load employees with their department. When I introduce cache, custom query is not executed only once (because it is cached), and subsequent calls return ...

4. Transient fields and second level cache    forum.hibernate.org

Hi, I am using second level cache and query cache with ehcache provider. I see that entities which are returned from cache have null transient fields every time. This behavior is fine for me. Can i rely on this behavior? Does hibernate clone the cached entities(transient fields are not shared) or reuse the same entity instances? Thanks!

5. L2 cache indexed by non @Id field    forum.hibernate.org

I'm using tomcat+hibernate+ehcache I haven't been able to find a definitive answer as to whether named queries will pull from the L2 cache if the where clause does not use the id of the class. In the following class, my system always goes to the DB for "Group.getByHandle". (all the annotations are JPA except the @Cache) Is there a way to ...