-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Hibernat 4.2.1:Collections are not cached in 2nd level cache
PostPosted: Wed May 15, 2013 1:42 pm 
Newbie

Joined: Wed May 15, 2013 1:33 pm
Posts: 2
Hello,
After migration from 3.6.3 to 4.2.1 all non-lazy collections in the classes that are configured for caching in 2nd level cache are not cached (or at least behave like not cached). Main object is not read from the database when loaded by id 2nd time while all referenced non-lazy collections (also configured to be cached) are read from DB each time when object is loaded by id.
Switching to 4.1.13 solved the issue.
Is it some known problem (didn't find in in jira)?
Example hbm.xml:

Code:
<hibernate-mapping default-lazy="false" default-access="field">
   <class name="com.example.Language" table="lang" mutable="false">
      <cache usage="read-only"/>
      <id name="id" type="string">
         <column name="id" not-null="true" length="2"/>      
         <generator class="assigned"/>   
      </id>
      <property name="active" column="c_active" not-null="true"/>
      <map name="texts" table="lang_tx" mutable="false">
         <cache usage="read-only"/>      
         <key column="lang_id"/>
         <index column="lang" type="string" length="2"/>
         <element column="text" type="string" length="100" not-null="true" />
      </map>               
   </class>
</hibernate-mapping>


Thank you.


Top
 Profile  
 
 Post subject: Re: Hibernat 4.2.1:Collections are not cached in 2nd level cache
PostPosted: Tue May 21, 2013 6:06 am 
Newbie

Joined: Tue May 21, 2013 6:01 am
Posts: 1
Hello,

I got the same error when i migrated from hibernate 4.1.8.Final to 4.2.1.Final,

It seems that's collections of objects are cached but are not retrieved in the next calls.
hibernate logs shows selects however collections are already cached by ehcache.

I rolled back to hibernate 4.1.x.


Top
 Profile  
 
 Post subject: Re: Hibernat 4.2.1:Collections are not cached in 2nd level cache
PostPosted: Tue May 21, 2013 11:43 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 18, 2012 5:03 am
Posts: 36
Location: Fort Wayne, Indiana, USA
This was corrected in https://hibernate.atlassian.net/browse/HHH-8250. Give 4.2.2-SNAPSHOT a try? 4.2.2.Final should be out tomorrow.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.