Skip to content

Conversation

@maca88
Copy link
Contributor

@maca88 maca88 commented May 17, 2020

Fixes #2380

var queryModel = NhRelinqQueryParser.Parse(_expression);
// Use the modified TransparentIdentifierRemovingExpressionVisitor in order to support expressions that were created
// programmatically and do not mimic what the C# compiler generates.
queryModel.TransformExpressions(TransparentIdentifierRemovingExpressionVisitor.ReplaceTransparentIdentifiers);
Copy link
Member

Choose a reason for hiding this comment

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

Fortunately that is cached in the query plan cache, so it is acceptable to traverse it again I think.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree, the only thing that we could do is to make the capacity of the query cache configurable as currently is hardcoded to 128

private readonly SoftLimitMRUCache planCache = new SoftLimitMRUCache(128);

which may be a little to small for larger applications. Of course, this should be done in a separate PR.

Copy link
Member

Choose a reason for hiding this comment

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

Of course, this should be done in a separate PR.

Especially since that could be a deep rabbit hole. I think we should instead get rid of this SoftLimitMRUCache and use something like System.Runtime.MemoryCache.

The limit is hardcoded to 128, but that is not a strong limit. SoftLimitMRUCache uses only weak references past 128 entries and lets the garbage collector decides whether to free them or not.

@hazzik hazzik merged commit 02fc529 into nhibernate:master May 19, 2020
@fredericDelaporte fredericDelaporte added this to the 5.3 milestone May 19, 2020
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.

OData NotSupportedException MemberInit on base class member

3 participants