Uploaded image for project: 'Spring.NET'
  1. Spring.NET
  2. SPRNET-1418

Support for caching NHibernate configuration via serialization

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 1.3.2
    • Fix Version/s: 2.0
    • Component/s: Spring-NET-NH
    • Labels:
      None

      Description

      NHibernate startup time is very long. Big part of this is related to parsing xml mappings while building configuration object. Solution for this is reading configuration object from cache as described by other people: http://wiki.sharparchitecture.net/%28S%28qrglpv55m25xhx55fukhzg55%29%29/Default.aspx?Page=NHibernate%20Configuration%20Cache&AspxAutoDetectCookieSupport=1 or http://entron.wordpress.com/2010/01/06/optimizing-application-startup-time-with-fluent-nhibernate-and-unhaddins/

      Unfortunately with Spring.NET it can't be done. For my own needs I've modified source code of Spring.NET to do that. It was enough to change signature of LocalSessionFactoryObject.PostProcessConfiguration method. I've just added ref keyword to the parameter. Then I've used modified class as attached (I'm also using Fuent NHibernation).

      This is simple but not very good solution - because I think that PostProcessConfiguration should not be used for this purpose under current name.
      Anyway similar functionality is necessary.

      Maybe it would be enough to provide 3 additional virtual methods in LocalSessionFactoryObject:

      • IsConfigurationFileValid with default implementation returning true;
      • SaveConfiguration - empty;
      • LoadConfiguration - returning NotImplemented exception
        and then one could override this with custom caching implementation?

        Attachments

          Activity

            People

            • Assignee:
              sbohlen Steve Bohlen
              Reporter:
              robsosno Robert Sosnowski
            • Votes:
              3 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: