LinqConnect 3.2.82.0, CompiledQueryCache, and ASP.NET

Discussion of open issues, suggestions and bugs regarding LinqConnect – Devart's LINQ to SQL compatible ORM
Post Reply
dnchris
Posts: 10
Joined: Wed 05 Dec 2012 17:31

LinqConnect 3.2.82.0, CompiledQueryCache, and ASP.NET

Post by dnchris » Wed 11 Feb 2015 22:44

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?

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: LinqConnect 3.2.82.0, CompiledQueryCache, and ASP.NET

Post by MariiaI » Thu 12 Feb 2015 12:24

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

dnchris
Posts: 10
Joined: Wed 05 Dec 2012 17:31

Re: LinqConnect 3.2.82.0, CompiledQueryCache, and ASP.NET

Post by dnchris » Thu 26 Feb 2015 16:26

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?

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: LinqConnect 3.2.82.0, CompiledQueryCache, and ASP.NET

Post by MariiaI » Fri 27 Feb 2015 11:32

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.

dnchris
Posts: 10
Joined: Wed 05 Dec 2012 17:31

Re: LinqConnect 3.2.82.0, CompiledQueryCache, and ASP.NET

Post by dnchris » Fri 27 Feb 2015 19:15

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.

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: LinqConnect 3.2.82.0, CompiledQueryCache, and ASP.NET

Post by MariiaI » Mon 02 Mar 2015 07:07

If you have any further questions regarding working with LinqConnect, feel free to contact us.

Post Reply