cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lon Varscsak <>
Subject Bug when serializing/deserializing objects
Date Tue, 26 Feb 2019 17:54:09 GMT
Hey all,

A few weeks ago I posted an email about a bug when serializing, and I never
really looked much more in to it.  However, I've now encountered a
different issue if I'm using Map based data objects.  If I have a data
object, access a relationship, then serialize the object (and it's
DataContext) then deserialize the object and then try to access the
relationship again, I get this exception:


at org.apache.cayenne.util.RelationshipFault.isTransientParent(

at org.apache.cayenne.util.PersistentObjectList.isFault(

at org.apache.cayenne.util.PersistentObjectList.resolvedObjectList(

at org.apache.cayenne.util.PersistentObjectList.iterator(

at com.smarthealth.cayennetest.App.main(

It appears that the relationshipOwner variable on the ToManyList object is
null (which is an invalid state).  If I switch to field based objects, I
have no exception and things work as expected.  Also if I don't access the
relationship before serialization, then there is no error on

You can download a test application here:

If you want to flip between Map based and Field based, you can update the
pom.xml file (you'll see that commented out in the build section) and
trigger a build which should trigger the cgen task (doesn't always work for
me, so sometimes I just delete the _ files and that's enough to trigger a

I'm pretty comfortable switching to field based objects, but feel like this
should be addressed (or at least understood).

Thanks for your time,


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message