-
Notifications
You must be signed in to change notification settings - Fork 933
Fix #2608 - persisting a one-to-one with delayed insert fails #2609
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
Conversation
<generator class="increment"/> | ||
<generator class="foreign"> | ||
<param name="property">Person</param> | ||
</generator> |
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.
We already had a test really near what is required for reproducing #2608, unfortunately ignored and anyway, not using an id strategy on its parent which would be adequate for triggering the bug. As switching the parent id strategy would impact other tests, I have just fix that other test.
Strictly speaking it should go in a dedicated PR, but let it be here.
{ | ||
var p = new Person { Name = "steve" }; | ||
p.Details = new PersonalDetails { SomePersonalDetail = "I have big feet", Person = p }; | ||
s.Merge(p); |
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.
It looks like the same exception should be thrown on Persist
too. Am I right?
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.
No, persist does not fail, it least with my tests on a modified MergeFixture.
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.
Strange... I thought it's directly related to #1754 in which case Persist should fail the same (at least for this test case). I added test for Persist - let's see...
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.
And Persist fails the same...
it least with my tests on a modified MergeFixture.
But in current state it also doesn't fail on Merge.... The only failed tests are newly added GH2608
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.
The MergeFixture
one fails if we change its id generator from increment
to identity
. But as this would mean changing from a app-side generated id to a db-side one, I have not done that change, it would change too much the test.
I have re-checked these GH2608 tests on 5.2.x just in case, both succeed on 5.2.x.
About working on a fix, it will be maybe on next week-end, if not done by someone else before that. |
So it's regression after #1754. Reason: Delayed foreign id is not supported (exception is thrown when |
3693c99
to
a9861ba
Compare
The fix is not hard after all, while keeping things delayed. |
…ls (nhibernate#2609) Co-authored-by: Roman Artiukhin <[email protected]>
Fix #2608.