2

Resolved

An unhandled exception of type 'System.StackOverflowException' occurred in mscorlib.dll

description

This could be only my issue, but here is my test case:

Dim objects As List(Of PocoObject) = pocoSession.List(Of PocoObject)(2).Get()

Just this generates an exception in debug (or crashes test agent if not in debug):

An unhandled exception of type 'System.StackOverflowException' occurred in mscorlib.dll

It occurs in "Enact" in AutoPoco.Engine.ObjectPropertySetFromSourceAction at the end of the method (it just points to the end bracket).

The type of the "target" parameter is a poco object that is part of a collection (public get, protected set) in "PocoObject" but that is all I can see.

comments

kayub wrote Jan 12, 2011 at 5:11 PM

Could be related to Issue #23

robashton wrote Jan 12, 2011 at 5:32 PM

Not related to #23, I'll take a guess that it's what I am fixing right now this very second because I'm adding some parent/child support and I've ended up with AutoSource<T> going crazy and descending through infinite levels of recursion.

public class PocoObject Node
{
 public PocoObject Property { get; set; }
}

That kind of thing - workaround would be to remove the rule for the PocoObject property and set it manually.

In AutoPoco 1.1 (and the current trunk), it is possible to get the history of the request from the root object and calculate depth - I'll be sticking a limit in the configuration for depth of object created as a first step for fixing this

robashton wrote Jan 12, 2011 at 6:37 PM

Okay, latest trunk should fix this

kayub wrote Jan 13, 2011 at 8:35 PM

Doesn't NHibernate have a config "SetMaxFetchDepth," does that relate to what you're fixing? Can you/we set a level of depth to recurse?