Skip to content

Conversation

@kfedorchenko
Copy link

…lect n+1 problem (#1226)

fixed #1226

</PropertyGroup>
<ItemGroup>
<Compile Remove="NHSpecificTest\GH01226\**" />
<EmbeddedResource Remove="NHSpecificTest\GH01226\**" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,
I do not think the changes on the test csproj are needed. Please revert them or explain them.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it is wrong lines. I will fix them

</ItemGroup>
<ItemGroup>
<Folder Include="NHSpecificTest\GH1226\" />
</ItemGroup>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, but, this change too should not be needed. We have migrated to the new csproj format also for ceasing having changes in it just for adding a test. Is there a specific reason this test would require this change while the other tests do not?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I missed this changes in the VS file format, thanks

@fredericDelaporte fredericDelaporte self-requested a review December 7, 2017 21:10
@fredericDelaporte
Copy link
Member

fredericDelaporte commented Dec 11, 2017

I have re-formatted the test case for them to comply with contributing guideline. Their async counterparts are lacking, but I cannot regenerate the async files because your PR use an out-of-date base, 59 commits behind NHibernate master.

Please rebase your master for having it even with current NHibernate master, then rebase your PR (and squash its four eight commits together by the way, amend the result with an async regen as explained in contributing).

About changes in Loader, I would rather avoid the almost code duplication it represents. But I still have to better analyze this issue.

ILoadable entityPersister = (ILoadable) persister;
string[][] cols = EntityAliases[i].SuffixedPropertyAliases;

object[] values = entityPersister.Hydrate(rs, id, obj, entityPersister, cols, eagerPropertyFetch, session);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here, there is a trouble. The referenced property may be mutable. If it has changed in DB but is still loaded in session with the old value, we are then going to associate a unique key on the new value with an entity still holding the old value. Instead of reading its value from the result set, it should be read from the entity in session (obj).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to test this case.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in #1492.

@fredericDelaporte
Copy link
Member

My last commit change the fix for a more proper implementation in my opinion.

@kfedorchenko
Copy link
Author

@fredericDelaporte Thanks, I will make changes corresponding your recommendations. Also I did not make changes to corresponding async method InstanceAlreadyLoadedAsync.

@fredericDelaporte
Copy link
Member

Also I did not make changes to corresponding async method InstanceAlreadyLoadedAsync.

Just in case, I remind you this is the job of the async generator, do not make them manually. Run the async generator instead. But this requires first to update this branch.

@fredericDelaporte
Copy link
Member

My last commit causes a regression in a test, so it needs more work too.

@fredericDelaporte
Copy link
Member

I have added the fix, everything is to be squashed in a single one (or will be squashed when merging).

hazzik and others added 7 commits December 13, 2017 13:04
- The factory generates high-efficient static proxies (no interceptor)
- Add tests for legacy logger
- Don't split global state for logging.

Fixes nhibernate#1478
* Remove logic duplication for getting default NHibernate type for a CLR type.
* Test all defaults for CLR type having many possibilities.
* Clean-up.
* And fix ComponentType.IsModified(…) method throws exception when used with a component as "old" parameter.
* Fix nhibernate#1486
@fredericDelaporte
Copy link
Member

fredericDelaporte commented Dec 16, 2017

Please rebase your master for having it even with current NHibernate master, then rebase your PR (and squash its four eight commits together by the way, amend the result with an async regen as explained in contributing).

Done in #1492. If you take time doing it yourself on your PR, we will merge it. Otherwise my PR will likely be merged and this one closed as replaced.

@fredericDelaporte
Copy link
Member

Hi,

Commits from master should not appear here. I guess something went wrong in the way this branch was brought up-to-date with master.

It should look like in #1492, where only the changes of this PR appear, while still having the latest commit from master.

May you try re-basing again?

Assuming your local branches are named the same than your remotes one, this should be doable with:

git checkout GH1226
git rebase master

Here you may have a bunch of conflict to solve. Solve each conflict, re-add each file which were in conflict (stage it), then continue with:

git rebase --continue

This may lead to another conflicts to resolve, in such case resolve those other ones the same way.
The conflict resolution may also cause the conflicting commit to went empty, which would then prevent continuation: in such case the commit should be dropped with:

git rebase --skip

And ultimately the rebase will end.
At that point, you should then update your remote with a forced push. A normal push will be rejected, telling you to pull before, but do not do that. When rebasing a branch having its own commits, the remote must be overridden with a forced push.

git push -f

@hazzik
Copy link
Member

hazzik commented Dec 22, 2017

Duplicate of #1492

@hazzik hazzik marked this as a duplicate of #1492 Dec 22, 2017
@hazzik hazzik closed this Dec 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NH-2534 - Join-fetching a many-to-one with property-ref results in select n+1 problem

7 participants