-
Notifications
You must be signed in to change notification settings - Fork 933
WIP Cascade entities loaded during flush #2103
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
base: master
Are you sure you want to change the base?
Conversation
This is extremely weird use case. I spent too much time trying to understand what's going on. |
Yeah. I agree test case from #1252 is very weird. But in general this PR covers condition when entity is modified on loading event and this loading happens during flush for whatever reasons (non lazy association or something like that) In test case it's not even loading it's proxy creation. |
To be dropped.
This is what it takes to make the test green (90ea467):
|
The culprit is |
The test becomes green when either:
|
That's because of stupid logic inside property setter. Yeah test is strange and I should have come up with something more simpler and clear instead of reusing it. But again the issue should be clear: entity is loaded and modified during flush. Cascade changes won't be applied for such entities. If you have some complex checks in interceptor - it's quite possible scenario (I've personally investigated it in some legacy app). I will try to add some simple test demonstrating this behavior as I agree current test is hard to understand |
Actually I can't come up with anything that looks sane :) Maybe such scenarios are indeed should be considered too specific to be handled in nhibernate. So feel free to close this PR... |
This still holds. |
These tests need a sensible asserts at least. They currently do not check anything (except implicit check for |
This change allows to properly flush and cascade entities that were loaded and modified during flush (I know this is not recommended way of doing things but sometime it can be useful)
Fixes #1252