1

Closed

Commits are always recursive (nested contexts)

description

Closed Mar 2, 2008 at 8:04 PM by matshelander
The name of the event was changedc to the somewhat less cumbersome (and less false, in some situations (not to mention correctly spelled)) AcquiredIdentity.

Inside NPersist has been updated to describe the new event and how recursive commits work under the Nested Contexts chapter.

/Mats

comments

matshelander wrote Feb 28, 2008 at 5:26 PM

This has been fixed but Inside NPersist needs to be updated with some new information about how this has been solved. I will mark this issue as Fixed when Inside NPersist has been updated.

Until then: the context has a new boolean property called AlwaysCommitRecursive which defaults to true. When it is true, calling Commit will give the same behavior as calling CommitRecursive.

When you create a new child context, you can either pass in the value you want to give it for alwaysCommitRecursive in a new parameter in the constructor or, if you don't, the child context will get the value from the property of the parent context you pass to the constructor.

NPersist also got a new event, OnAquiredSourceAssignedIdentity. The primary subscriber to this event will be child contexts, listening to this event from parent contexts. This way, when you do a non-recursive commits for new objects that will get their identites assigned by the database will be able to update the child context objects with this information when/if they are saved to the database by the root context.

/Mats

wrote Feb 28, 2008 at 5:26 PM

wrote Feb 28, 2008 at 5:26 PM

wrote Mar 2, 2008 at 8:04 PM

wrote Feb 2, 2013 at 3:08 AM

wrote May 14, 2013 at 8:29 AM