NH-3848 - Tests and fix for HQL#463
Conversation
|
Rebased to resolve conflicts |
This comment has been minimized.
This comment has been minimized.
| } | ||
| } | ||
|
|
||
| public bool CanAddFetchedCollectionToCache |
There was a problem hiding this comment.
This probably needs to be moved to a loader, however, I'm not entirely sure.
There was a problem hiding this comment.
Shouldn't it be CanAddFetchedCollectionsToCache? (Collection is switched to plural.)
If I understand well this PR, contrary to #460, it would disable collection caching for the whole query, not just for the collection having restrictions.
This probably needs to be moved to a loader, however, I'm not entirely sure.
I am not sure either. It may require to expose some internal state of the translator for the loader to analyse it, and then, better keep it in the translator.
| } | ||
| } | ||
|
|
||
| public bool CanAddFetchedCollectionToCache |
There was a problem hiding this comment.
Shouldn't it be CanAddFetchedCollectionsToCache? (Collection is switched to plural.)
If I understand well this PR, contrary to #460, it would disable collection caching for the whole query, not just for the collection having restrictions.
This probably needs to be moved to a loader, however, I'm not entirely sure.
I am not sure either. It may require to expose some internal state of the translator for the loader to analyse it, and then, better keep it in the translator.
Also add transactions since using second level cache without transactions is a bad practice.
fredericDelaporte
left a comment
There was a problem hiding this comment.
@bahusoid change is a good improvement in my opinion.
And do some minor cleanup
|
But it seems to fully fix NH-3848 filter case (when collection is filtered by |
Let's call it another bug, if confirmed. |
This pull should be treated as a hint for fix or tests rather than actual fix (but maybe I'm wrong).
It can harm performance (traversing Where clause tree or using String.StartsWith).
Actually we aren't using HQL in our application so this fix had to be done quick.
NH-3848.
Fixes #1341