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.