Note that there are some explanatory texts on larger screens.

plurals
  1. POSerialized NHibernate Configuration objects - detect out of date or rebuild on demand?
    text
    copied!<p>I've been using <a href="http://nhforge.org/blogs/nhibernate/archive/2009/03/13/an-improvement-on-sessionfactory-initialization.aspx" rel="nofollow noreferrer">serialized nhibernate configuration objects</a> (also discussed <a href="http://ayende.com/Blog/archive/2007/10/26/Real-World-NHibernate-Reducing-startup-times-for-large-amount-of.aspx" rel="nofollow noreferrer">here</a> and <a href="https://stackoverflow.com/questions/1625597/is-there-any-data-on-nhibernate-vs-fluent-nhibernate-startup-performance/1794569#1794569">here</a>) to speed up my application startup from about 8s to 1s. I also use fluent-nhibernate, so the path is more like </p> <ol> <li>ClassMap class definitions in code </li> <li>fluentconfiguration</li> <li>xml</li> <li>nhibernate configuration</li> <li>configuration serialized to disk.</li> </ol> <p>The problem from doing this is that one runs the risk of out of date mappings - if I change the mappings but forget to rebuild the serialized configuration, then I end up using the old mappings without realising it. This does not always result in an immediate and obvious error during testing, and several times the misbehaviour has been a real pain to detect and fix.</p> <p>Does anybody have any idea how I would be able to detect if my classmaps have changed, so that I could either issue an immediate warning/error or rebuild it on demand?</p> <p>At the moment I am comparing timestamps on my compiled assembly against the serialized configuration. This will pickup mapping changes, but unfortunately it generates a massive false positive rate as ANY change to the code results in an out of date flag. I can't move the classmaps to another assembly as they are tightly integrated into the business logic.</p> <p>This has been niggling me for a while so I was wondering if anybody had any suggestions?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload