Alachisoft / NCache

NCache: Highly Scalable Distributed Cache for .NET
http://www.alachisoft.com
Apache License 2.0
647 stars 123 forks source link

NCacheLINQ Sample Fails with Partitioned Cache #41

Open DAConsulting opened 5 years ago

DAConsulting commented 5 years ago

I have noticed that when referencing NCache.Linq, InitializeCache fails or hangs when attempting to use a "partitioned" cache. This is reproducible by changing the cache used in the NCacheLINQ sample project from "myCache" to "myPartitionedCache". Simply removing the reference solves the problem (but of course, eliminates the ability to use Linq queries).

I have not found any documentation indicating that NCache Linq can only be used with a "local" cache?

If anyone has a solution for this (using Linq with partitioned cache) or information as to why we cannot use Linq with a partioned cache, kindly let us know.

Thanks.

DAConsulting commented 5 years ago

Note: The NCache.Linq Nuget packages add configurations to the local project, which was causing initialization on another cache to fail. Because the name "myCache" was setup in NCHOME and locally as a result of the NuGet install, that worked. I did not notice the local configurations until later, after fiddling around and scratching my head for a while. So.. this issue is probably not an issue.

Brad-NCache commented 5 years ago

Hello DAConsulting,

Thank you for updating us on the fix. Yes, the SDK NuGet package automatically copies the client.ncconf and config.ncconf files into a project on installation. Please let me know if you have any other issues using NCache.

DAConsulting commented 5 years ago

I suggest this is a bad practice. The assembly packages being installed are "generic"- not specific to an sample or tutotial.

It took me a while to notice that the problems I was having were the result of a configuration change - which by chance was using the same name as one of my caches. One out of the two names used in the configurations were the same, which led to the appearance of things still working if I used my local cache "myCache"... but not when I used the partitioned cache.

Modifying local configurations as a part of a NuGet package installation is a bit "sinister", IMO. It should be removed.

David Arndt Consulting www.davidarndtconsulting.co http://www.davidarndt.co 973.464.7065

On Fri, May 3, 2019 at 2:50 PM Brad-NCache notifications@github.com wrote:

Hello DAConsulting,

Thank you for updating us on the fix. Yes, the SDK NuGet package automatically copies the client.ncconf and config.ncconf files into a project on installation. Please let me know if you have any other issues using NCache.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Alachisoft/NCache/issues/41#issuecomment-489201967, or mute the thread https://github.com/notifications/unsubscribe-auth/ALZK5XC6KVJ4UPZ3EJNTH3LPTSCPTANCNFSM4HKUO5SA .

Brad-NCache commented 5 years ago

Hello DAConsulting,

The local configurations are shipped with the NuGet package for a number of reasons. Some of the important ones are:

If you have any other questions regarding NCache, please do let us know.

DAConsulting commented 5 years ago

It's clear why it was setup this way, but the bigger point is that having your configuration overridden as as result of installing the NCache LINQ support package is devious - it only happens upon installing the LINQ support. So... if you have everything working, then pull in LINQ support from NuGet, all of a sudden, things stop working. I think I would be better practice to include a sub-folder with the configurations, along with a readme. Installing a NuGet package should not override one's environment settings or configuration, but only install the required assemblies for use by the consumer.

BTW... NCache is great. Love it.

-da

On Tue, May 7, 2019 at 11:36 AM Brad-NCache notifications@github.com wrote:

Hello DAConsulting,

The local configurations are shipped with the NuGet package for a number of reasons. Some of the important ones are:

-

No Local NCache Installation: In case there is no local NCache installation, the application developer can still make use of the NCache in-proc cache that runs within the application address space. The local in-proc cache enjoys many of NCache features including ASP.NET session and view caching, Entity Framework Caching Provider etc.

NCache client.ncconf Settings: NCache works by looking for a client.ncconf file first within the application project solution and finding it there, initializes the cache with the settings therein. This is useful in cases where the cache communication settings are to be made specific to the application.

If you have any other questions regarding NCache, please do let us know.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Alachisoft/NCache/issues/41#issuecomment-490132486, or mute the thread https://github.com/notifications/unsubscribe-auth/ALZK5XH7ABAWMHGQXANYVP3PUGOYDANCNFSM4HKUO5SA .

Brad-NCache commented 5 years ago

Hello DAConsulting,

Thanks for your helpful feedback and your concerns. I will pass this on to engineering and raise your points with them. If you have any further questions about working with NCache or ideas on how NCache can better serve your application requirement, please do let us know.

Regards,

Brad