I saw it's possible to speed nh app with configuration serialization (e.g. http://www.lucisferre.net/post/2009/06/18/Speed-up-nHibernate-startup-with-object-serialization.aspx). Is it pssible to serialize nh configuration in medium trust env. ?
views:
93answers:
2While it might be possible (you'd have to try), remember that configuration serialization makes the most sense for desktop applications, that are launched many times a day.
Web applications, on the other hand, are "started" (i.e. accessed for the first time) only once in a while, making serialization unnecessary.
Even if you can't serialize it to a binary file, it is apparently still faster to load the configuration if all the config is contained within a single XML file. Something to do with serializing and concatenating multiple XML config files. I have not personally tried it but it is worth testing out.
Another approach would be to use FluentNH. It still generates XML streams on the backend, but I believe it doesn't write them out so there is no concatenation or file read steps.
Finally I believe Fabio is working on a built-in fluent configuration for NH3.0 which will not involve any XML serialization whatsoever.
http://fabiomaulo.blogspot.com/2010/02/conform-nhibernate-un-mapping.html