PersistenceContext EntityEntries Delete and Flush #3245
-
We are using the Can someone tell me if that is the expected behaviour for deleted entities in If this is the expected behaviour, then it seems the only way to get a complete list of all entities used in a unit of work would be to track them all manually using the event system, or am I missing something? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Yes, a gone entity is removed from the persistence context. See nhibernate-core/src/NHibernate/Action/EntityDeleteAction.cs Lines 77 to 84 in 07c367f
The
You could use the persistence context for most entities and track deleted ones through events. |
Beta Was this translation helpful? Give feedback.
Yes, a gone entity is removed from the persistence context. See
EntityDeleteAction
.nhibernate-core/src/NHibernate/Action/EntityDeleteAction.cs
Lines 77 to 84 in 07c367f
EntityEntry.PostDelete
is the only thing that does affect theGone
status, and that is the only place where it is called. As you can see, it is called after removing the entry from the context.The
Gone
status is useful for NHib…