Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Toplink -> EclipseLink Upgrade - new object change set - possible bug?

The new object should not be merged, the parent should be invalidated. Please file a bug.
--Gordon

Russell Teabeault wrote:
We have recently upgraded from Toplink to EclipseLink 1.1.1.  In toplink we
were relying on new object change sets being propagated across the cluster
using cache coordination.  As I understand it EclipseLink by default (for
performance) does not send changes for new objects.  This is causing a
problem for us that I hope can be cleared up.  We have a mapped object
called PreferenceStore that contains a value holder pointing to a collection
of Preference(s).  Each Preference has a value holder that has a back
pointer to its PreferenceStore.  When adding a new Preference to an existing
preference store on VM A it appears that EclipseLink is sending a change
notification across the cluster for the PreferenceStore.  The change set has
a child change for the added preference but all of its fields are empty
(since it is new and new changes are not propagated).  Now on VM B if we ask
for the new Preference from the PreferenceStore it finds the Preference in
the cache but all of its fields are null.  In other words the new Preference
has been placed in the local cache of VM B but none of its attributes are
there.  If changes for new objects are not propagated then shouldn't Objects
that have a new object added to a collection be invalidated so that it will
reread the collection?

Here are the relevant mappings:
PreferenceStore:
        OneToManyMapping preferencesMapping = new OneToManyMapping();
        preferencesMapping.setAttributeName("preferences");
preferencesMapping.setReferenceClass(com.f4tech.slm.domain.Preference.class);
        preferencesMapping.useBasicIndirection();
        preferencesMapping.privateOwnedRelationship();
        preferencesMapping.useCollectionClass(java.util.ArrayList.class);
preferencesMapping.addTargetForeignKeyFieldName("PREFERENCE.PREFERENCE_STORE_OID",
"PREFERENCE_STORE.OID");
        descriptor.addMapping(preferencesMapping);

Preference:
        OneToOneMapping preferenceStoreMapping = new OneToOneMapping();
        preferenceStoreMapping.setAttributeName("preferenceStore");
preferenceStoreMapping.setReferenceClass(com.f4tech.slm.domain.PreferenceStore.class);
        preferenceStoreMapping.useBasicIndirection();
preferenceStoreMapping.addForeignKeyFieldName("PREFERENCE.PREFERENCE_STORE_OID",
"PREFERENCE_STORE.OID");
        descriptor.addMapping(preferenceStoreMapping);

Thanks.


Back to the top