Thanks for reply quickly!
In the first post, i do not write all the code to simplify. I cache VerticeHB, AristaHB and VerticeHB.arista (the collection). Perhaps cache`s collection is wrong.
Thanks!
Complete mapping code:
Vertice.hbm.xml
Code:
<hibernate-mapping>
<class name="VerticeHB" table="MLS.VERTICE" mutable="false" >
<cache usage="read-only"/>
<id name="id" column="id" type="long">
<generator class="sequence">
<param name="sequence">mls.vertice_seq</param>
</generator>
</id>
<property name="x"/>
<property name="y"/>
<set name="arista" lazy="true" inverse="true" >
<cache usage="read-only"/>
<key column="id_parent"/>
<one-to-many class="AristaHB"/>
</set>
</class>
<class name="AristaHB" table="MLS.V_ARISTA" mutable="false">
<cache usage="read-only"/>
<id name="idA" column="id_A">
<generator class="sequence">
<param name="sequence">mls.vertice_seq</param>
</generator>
</id>
<many-to-one name="id1" column="id_parent" not-null="true" />
<many-to-one name="id2" column="id_next" not-null="true" />
</class>
</hibernate-mapping>
And ehcache.xml
Code:
<ehcache>
<diskStore path="java.io.tmpdir"/>
<defaultCache maxElementsInMemory="10000" eternal="false" timeToIdleSeconds="120" timeToLiveSeconds="240" overflowToDisk="false"/>
<cache name="AristaHB" maxElementsInMemory="10000" eternal="false" timeToIdleSeconds="3000" timeToLiveSeconds="6000" overflowToDisk="false"/>
<cache name="VerticeHB" maxElementsInMemory="10000" eternal="false" timeToIdleSeconds="3000" timeToLiveSeconds="6000" overflowToDisk="false"/>
<!-- The collection -->
<cache name="VerticeHB.arista" maxElementsInMemory="10000" eternal="false" timeToIdleSeconds="3000" timeToLiveSeconds="6000" overflowToDisk="false"/>
</ehcache>