I cannot control the cascade depth. No matter what I do, NH retrieves
the entire object graph and all associations. It stops at some level
(there is recursion otherwise) though the data is too big and complex
for me to analyze exactly where.
I am presently trying to set the depth to zero (I also tried one) in
an attempt to get something recognizable to happen. It is not working.
Can you see what I am doing wrong?
This method looks up the root object:
public virtual LEAInfo getFirst()
{
Orm.startSession();
var dbResult = (from testList
in Orm.session.Linq<LEAInfo>()
select testList)
.Skip(0)
.Take(1);
LEAInfo outObj = dbResult.First<LEAInfo>();
return outObj;
}
Orm.startSession creates a static session. It works just like I expect
it to when I am saving things. Note the use of max_fetch_depth:
public static ISession startSession(){
if (HttpContextAccess.getSessionVariable("session") ==
null)
{
Configuration config = new
NHibernate.Cfg.Configuration()
.SetProperty("max_fetch_depth", "0");
config.Configure();
ISessionFactory sessionFactory =
config.BuildSessionFactory();
ISession newSession = sessionFactory.OpenSession();
HttpContextAccess.addSessionVariable("session",
newSession);
}
return
(ISession)HttpContextAccess.getSessionVariable("session");
}
Thanks for your help.
tqii
--
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/nhusers?hl=en.