-
Notifications
You must be signed in to change notification settings - Fork 934
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes cascading orphan delete on versioned entity #3326
Conversation
VisitCollectionsBeforeSave must be called no matter if substitute is already true. On versioned entities this is always the case.
Looks like similar hibernate fix hibernate/hibernate-orm#3513 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've aligned tests to Hibernate and also applied @fredericDelaporte's suggestion
src/NHibernate.Test/Immutable/EntityWithMutableCollection/AbstractEntityWithManyToManyTest.cs
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hibernate fix also uses optimization with additional isNewlyInstantiated
check
default boolean isNewlyInstantiated() {
return getKey() == null && !isDirty();
}
It's wrong and breaks case when unwrapped collection is used for modifications. Adjusted test case to catch this case if someone decides to port this "optimization"
Shall we notify them? |
VisitCollectionsBeforeSave must be called no matter if substitute is already true. On versioned entities this is always the case.
Fixes #3325