Re: NH parent-child dirtty collection strategies

13 views
Skip to first unread message

Michael W Powell

unread,
Jun 15, 2025, 5:50:38 PMJun 15
to Fluent NHibernate
Hello,

Would someone mind addressing this question? Basically just needing to know how string NH is at dealing with the dirty collection reconciliation process; adding, updating, and especially deleting child instances, as appropriate.


Or the SO, either way.


Thanks!

Best regards,

Michael W. Powell

Michael W Powell

unread,
Jun 16, 2025, 8:30:38 PMJun 16
to Fluent NHibernate
Some updated observations leading me to believe that somehow possibly cached instances are not being handled properly as would-be orphans.


That is, our internal logistics via ObservableCollection<T> are doing the right thing by removing the instance from the source NH provided collection, and nullifying the parent relationship correctly, at least as far as domain models are concerned.

But when we turn around and signal SaveOrUpdate(...) to the session, we are finding the errors (see github discussion).

So... is our recourse to run without cache, and do the delete reconciliation manually? This was the same with EF. Or if there is a better way of handling it that it just flows naturally with the ORM, we are open to learning about it.

Best...

Michael W Powell

unread,
Jun 16, 2025, 8:31:56 PMJun 16
to Fluent NHibernate
Plus side, tangentially, we have an IUserType handling the pg domain numeric(20, 0) at any rate.
Reply all
Reply to author
Forward
0 new messages