3

Looking at this link shows me that compiled queries can be used to improve performance in Linq to SQL apps (I've seen other examples in Entity framework):

http://blog.linqexchange.com/index.php/how-to-use-compiled-queries-in-linq-to-sql-for-high-demand-asp-net-websites/

This requires a parameter that inherits DataContext - which I don't think NHIbernate has, but is the point of this question.

I have looked at these links:

https://nhibernate.jira.com/browse/NH-2389

Compile NHibernate Linq expressions

but I don't see an up-to-date and definitive answer.

If anyone has the answers, I would love to hear them :)

1 Answer 1

5

Inspecting the current NHibernate trunk, shows that NHibernate caches query plans for LINQ queries, so it is not necessary to explicitly compile queries for reuse. The only extra overhead is the calculation of the unique cache key for the LINQ expression.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.