Open nick-prat opened 7 years ago
@nick-prat What values are you using for USER_COUNT
and ACCOUNT_COUNT
?
@TanayParikh I tested with multiple different numbers, the crash always occurred on the first pass anyway
@nick-prat In that case I suspect there's a cyclic relationship in there (ie. User -> Account -> User
), I'll look through the models. Have you tried stepping through?
The issue is with the cyclic relationship caused by the foam.RELATIONSHIP
. Temporary solution by @nick-prat is to use the userId
.
foam.RELATIONSHIP({
sourceModel: 'net.nanopay.common.model.User',
targetModel: 'net.nanopay.common.model.Address',
forwardName: 'address',
inverseName: 'resident'
});
We'll need to update the Java JSON outputter to identify recursive relationships and stop output after a certain recursive depth.
Relationships shouldn't be output in JSON.
On 8 August 2017 at 11:49, Tanay Parikh notifications@github.com wrote:
The issue is with the cyclic relationship caused by the foam.RELATIONSHIP. Temporary solution by @nick-prat https://github.com/nick-prat is to use the userId.
foam.RELATIONSHIP({ sourceModel: 'net.nanopay.common.model.User', targetModel: 'net.nanopay.common.model.Address', forwardName: 'address', inverseName: 'resident' });
We'll need to update the Java JSON outputter to identify recursive relationships and stop output after a certain recursive depth.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/foam-framework/foam2/issues/588#issuecomment-320998419, or mute the thread https://github.com/notifications/unsubscribe-auth/AHHXswp21lysyK7Fz9yK5MYHwF182sRDks5sWIObgaJpZM4Ot9P0 .
This code
Causes a stack overflow while using these models
Beginning of the stack trace