asp.netnhibernatecachingncache

Alachisoft.NCache.Runtime.Exceptions.OperationFailedException: Cache is not initialized


We are using NCache as a 2nd level cache for NHibernate.

A local console test app is able to retrieve items from the cache.

However in our web app we receive 'Cache is not initialized'

We are using WCF to connect through a front site to a back site which runs the queries.

Anyone have any ideas on how to fix this error?

Thanks


Solution

  • Found out the problem to this was the way we were registering our backend WCF services with Castle.

    Using 'PerWcfOperation' or any other registration apart from Transient caused this error.

    Set our service lifecycles to Transient and it works as expected.

    Will look through the Castle source to find out why.