Hi,
I am trying to get EH cache to work with my application, and it seems to do a good job most of the time. However, for one particular class i get the error below. The interesting part is that this error only occurs when i activate EHCache. Without it, everything works just fine (with both Hibernate 3.2.5 and Hibernate 3.3.1)
Quote:
9032 [SwingWorker-pool-2-thread-4] WARN org.hibernate.engine.loading.LoadContexts - fail-safe cleanup (collections) : org.hibernate.engine.loading.CollectionLoadContext@1b29f80<rs=com.mysql.jdbc.JDBC4ResultSet@913c56>
9032 [SwingWorker-pool-2-thread-4] WARN org.hibernate.engine.loading.CollectionLoadContext - On CollectionLoadContext#cleanup, localLoadingCollectionKeys contained [1] entries
The class in question is mapped as follows:
Code:
<hibernate-mapping>
<class name="com.tracker.db.entities.KeywordNode" table="keywordnode">
<cache usage="read-write" />
<id column="id" length="36" name="id" type="com.tracker.db.usertypes.CustomUUID"/>
<discriminator column="type" not-null="true" type="java.lang.String"/>
<property column="name" length="200" name="name" type="java.lang.String"/>
<many-to-one cascade="none" class="com.tracker.db.entities.KeywordNode" column="parent_id" name="parent" lazy="false" />
<property column="status" length="1" name="status" type="java.lang.Integer"/>
<property column="flag" length="1" name="flag" type="java.lang.Integer"/>
<property name="updated" type="java.util.Calendar">
<column name="updated" sql-type="Date"/>
</property>
<bag cascade="all" inverse="true" name="children">
<key column="parent_id"/>
<one-to-many class="com.tracker.db.entities.KeywordNode"/>
</bag>
<subclass discriminator-value="ROOT" name="com.tracker.db.entities.KeywordRoot" />
<subclass discriminator-value="TYPE" name="com.tracker.db.entities.KeywordType" />
<subclass discriminator-value="KEYWORD" name="com.tracker.db.entities.Keyword">
<set cascade="all" inverse="true" lazy="false" name="synonyms">
<key column="keywordnode_id"/>
<one-to-many class="com.tracker.db.entities.Synonym"/>
</set>
</subclass>
</class>
</hibernate-mapping>
I suspect this has something do to with the fact that the class in question represents a node in a tree, and have associations to the same class as parent (and a bag of children).
When i remove the mapping to the parent, things also work fine.
Do i need to map my hierarchy structure differently? Is there something EHCache & Hibernate can't really cope with in this situation?
All hints & tips are most welcome!