Hi,
Can someone explain me one thing. I have standard mapping: a parent entity with collection of its children (child_1, child_2). I have also L2 cache synchronization between 2 nodes. Both nodes loads parent with children
collection, so that it is stored in L2. First node change something in child_1 and save it. Second node receive MergeChangeSetCommand and invalidate this child (cache is configured to invalidate objects). When I query again for a parent (on a second node)
I receive the same collection of children, child_1 is not changed.
Correct me if I'm wrong, but I suppose that whole parent should be invalidated, when one of its child is not valid. But my experiments show that only forcing database read will update child_1 in parent collection. How
can I ensure that collection will be refreshed in second node, after one of its element were invalidated?
I'm using eclipse link 2.3.1, which is quite old version, but migration to 2.5.0 did not solve my problem.
Entities are mapped using old toplink "style":
<class-mapping-descriptor xsi:type="relational-class-mapping-descriptor">
<class>Parent</class>
<primary-key>
<field table="TKL_CHILD" name="ID" xsi:type="column"/>
</primary-key>
<events/>
<querying/>
<attribute-mappings>
.....
<attribute-mapping xsi:type="one-to-many-mapping">
<attribute-name>children</attribute-name>
<reference-class>Child</reference-class>
<target-foreign-key>
<field-reference>
<source-field table="TKL_CHILD" name="ID_PARENT" xsi:type="column"/>
<target-field table="TKL_PARENT" name="ID" xsi:type="column"/>
</field-reference>
</target-foreign-key>
<bidirectional-target-attribute>parent</bidirectional-target-attribute>
<container xsi:type="list-container-policy" >
<collection-type>org.eclipse.persistence.indirection.IndirectList</collection-type>
</container>
<indirection xsi:type="transparent-collection-indirection-policy"/>
<selection-query xsi:type="read-all-query">
<reference-class>Child</reference-class>
<container xsi:type="list-container-policy">
<collection-type>org.eclipse.persistence.indirection.IndirectList</collection-type>
</container>
</selection-query>
</attribute-mapping>
<descriptor-type>independent</descriptor-type>
<locking>
<version-field table="TKL_PARENT" name="STEMPEL" xsi:type="column"/>
<store-version-in-cache>false</store-version-in-cache>
</locking>
<sequencing>
<sequence-name>SKL_PARENT</sequence-name>
<sequence-field table="TKL_PARENT" name="ID"/>
</sequencing>
<caching>
<always-refresh>true</always-refresh>
<only-refresh-cache-if-newer-version>true</only-refresh-cache-if-newer-version>
<cache-sync-type>invalidation</cache-sync-type>
</caching>
<instantiation/>
<copying xsi:type="instantiation-copy-policy"/>
<tables>
<table name="TKL_PARENT"/>
</tables>
</class-mapping-descriptor>
Cheers,
-----------
Andrzej