Skip to content

NH-2922 - Non-orphaned rows being deleted with cascade="all-delete-orphan" #1253

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

Open
nhibernate-bot opened this issue Oct 12, 2017 · 0 comments

Comments

@nhibernate-bot
Copy link
Collaborator

Phil Degenhardt created an issue — 26th October 2011, 1:38:33:

When a child is removed from a cascade="all-delete-orphan" bag and moved to a new parent (reparenting), NHibernate should throw an ObjectDeletedException with the message "deleted object would be re-saved by cascade (remove deleted object from associations)". This ensures that transactions will fail where users assume they can reparent such objects.

However, this exception is not thrown if the new parent object was loaded by the session before the current parent. In this case, the child object is deleted from the database and no warnings or exceptions are produced.

This bug has the potential to cause data loss and very difficult to find bugs.


Phil Degenhardt added a comment — 26th October 2011, 1:43:30:

Test case


Stefan Steinegger added a comment — 26th October 2012, 8:20:52:

Agree, but this isn't a blocker in my opinion, because it doesn't block anyone who is using NH correctly.


Phil Degenhardt added a comment — 14th January 2014, 5:47:03:

So what about the failing test case is using NH 'incorrectly'?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants