Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] Invalid collection element ramains in L2 cache

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

 



Powy¿sza wiadomo¶æ skierowana jest do okre¶lonego odbiorcy i zawiera tre¶ci przeznaczone tylko dla niego. Ujawnianie tych tre¶ci osobom trzecim b±d¼ nieuzasadnione wykorzystywanie do w³asnych celów jest zabronione. Je¶li otrzyma³e¶ tê wiadomo¶æ omy³kowo prosimy usuñ j± i skontaktuj siê z nadawc±.

Euro Bank S.A. z siedzib± we Wroc³awiu 50-126, przy ulicy ¶w. Miko³aja 72, wpisany do Krajowego Rejestru S±dowego pod numerem KRS 0000025313, prowadzonego przez S±d Rejonowy dla Wroc³awia-Fabrycznej, VI Wydzia³ Gospodarczy KRS, posiadaj±cy NIP: 521-008-25-38, wysoko¶æ kapita³u zak³adowego: 563 096 032,05 PLN, wysoko¶æ kapita³u wp³aconego: 563 096 032,05 PLN.


Back to the top