Page 1 of 1

LinqConnect 3.2.82.0, CompiledQueryCache, and ASP.NET

Posted: Wed 11 Feb 2015 22:44
by dnchris
Using dotConnect 6.80.350, and LinqConnect 3.2.82.0, I notice that, on each new instance of my DataContext, the compiled query cache has been cleared and all queries need to be re-compiled anyway.

This is an ASP.NET application. Each new HTTP request creates a new DataContext and stores it in the HTTP request's items cache. There is only one kind of DataContext.

Under what conditions does the CompiledQueryCache get cleared?

Re: LinqConnect 3.2.82.0, CompiledQueryCache, and ASP.NET

Posted: Thu 12 Feb 2015 12:24
by MariiaI
Using dotConnect 6.80.350, and LinqConnect 3.2.82.0
We have made a major refactoring of the LinqConnect engine since version 4.0 (dotConnect for Oracle 7.0.6 released on 22-May-12). Since this version the references to System.Data.Linq are removed, LinqConnect uses only its own classes. There were a lot of fixes/improvements since this version (including the code generation, compiled query cache, etc.).

Thus, we recommend you to upgrade your LinqConnect. For example, download LinqConnect Professional Trial and perform these steps:
1) uninstall LinqConnect and other Devart products, which can use common assemblies (e.g. dotConnect for Oracle, etc.);
2) clear these folders:
- Program Files (x86)\Devart\dotConnect
- Program Files (x86)\Devart\Entity Developer
- Program Files (x86)\Common Files\Devart\dotConnect
- Program Files (x86)\Common Files\Devart\Entity Developer
3) remove all Devart.* and policy.*.Devart.* files from the GAC:
- C:\Windows\assembly\GAC_MSIL\
- C:\Windows\Microsoft.NET\assembly\GAC_MSIL
4) install LinqConnect Professional Trial.
5) regenerate the code and check that your code (*.Designer.cs file) doesn't contain "System.Data.Linq." and there is no reference to the System.Data.Linq assembly in the project.

Please tell us if this behaviour is reproducible with this version.

For more information about caching please refer to:
http://www.devart.com/linqconnect/docs/ ... eries.html

Re: LinqConnect 3.2.82.0, CompiledQueryCache, and ASP.NET

Posted: Thu 26 Feb 2015 16:26
by dnchris
The Compiled query cache is working as expected in LinqConnect 4.4.484. What is the best way to set the MaxSize of the cache?

Re: LinqConnect 3.2.82.0, CompiledQueryCache, and ASP.NET

Posted: Fri 27 Feb 2015 11:32
by MariiaI
Please try the code like this:

Code: Select all

 var nCache = Devart.Data.Linq.CompiledQueryCache.GetCache(context.GetType());
nCache.MaxSize = 20;
...

Please tell us if this information helps.

Re: LinqConnect 3.2.82.0, CompiledQueryCache, and ASP.NET

Posted: Fri 27 Feb 2015 19:15
by dnchris
This works, but I wrapped it in a volatile bool check so I do not attempt to set the size for every ASP.NET thread.

Re: LinqConnect 3.2.82.0, CompiledQueryCache, and ASP.NET

Posted: Mon 02 Mar 2015 07:07
by MariiaI
If you have any further questions regarding working with LinqConnect, feel free to contact us.