NHibernate configuration not cached in medium trust


The "App_Data/Sites/<tenant>/mappings.bin" file is always empty when running in medium trust. Can we find a way to cache it correctly in Medium Trust?
Closed Sep 27, 2013 at 10:54 PM by BertrandLeRoy


rpaquay wrote Dec 4, 2010 at 2:03 AM

Unfortunately, we can't find a way to make this work in Medium Trust. This has no correctness implication, just performance at startup.

attilah wrote Feb 6, 2011 at 10:39 PM

The SecurityException is not hitting only during startup, but for plenty of requests! Maybe having a way of disabling the caching can make it more faster or writing a custom serializer for NHibernate mapping configuration should be a way to go.

I did not (yet) try serializing it into JSON, but maybe that should work.

Also if Orchard set a static flag to true if a SecurityException once happenned during mapping serialization/deserialization and later checking this flag to save ourselves from the exceptions can be another solution!

erik_oppedijk wrote Sep 27, 2013 at 12:24 PM

Close because medium trust isn't available anymore in Orchard