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.
-
We are using the
EntityEntries
in thePersistenceContext
to inspect all the entities used in a unit of work just before the transaction completes. After some investigation, I have discovered when you delete an entity (which adds a deleted status entry intoEntityEntries
) and then cause a session flush (which can happen automatically), theEntityEntry
for the deleted entity is removed from thePersistenceContext
.Can someone tell me if that is the expected behaviour for deleted entities in
EntityEntries
? Given that there is also a Gone status for the EntityEntry, I was expecting it to remain in theEntityEntries
but with status changed to Gone.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.
All reactions