O'Reilly logo

NHibernate 3.0 Cookbook by Jason Dentler

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Reducing application startup time

The process of configuring NHibernate is fairly intensive and takes some time. NHibernate has to load, parse, and compile all our mappings and reflect the model. In this recipe, I'll show you how to reduce the startup time of your NHibernate application.

Getting ready

Complete the Configuring NHibernate with App.config recipe from the beginning of this chapter.

How to do it...

  1. Add a reference to System.Configuration.dll.
  2. Add a new class named ConfigurationBuilder.
  3. Add the following using statements:
    using System;
    using System.Configuration;
    using System.IO;
    using System.Reflection;
    using System.Runtime.Serialization.Formatters.Binary;
    using Configuration = NHibernate.Cfg.Configuration;
  4. In ConfigurationBuilder, add a private ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required