The configuration (returned by BuildConfiguration) is serializable, so it
can be stored (to disk) and reused.

2015-05-11 22:26 GMT+02:00 Ünal Akyüz <[email protected]>:

> I'm developing a website using Asp .Net MVC and NHibernate as ORM tool. I
> just implemented some patterns using some principles. These are IoC,
> Service-Repository and UoW.
>
> I'm using almost all features of NHibernate in terms of Caching like below
>
>    - Lazy Loading
>    - 2nd Level Cache
>    - Query Cache
>    - Entity Cache
>
> Up to now everything was fine, I can load whole web site in 1 second
> almost 7,5 MB size in total(mostly images from Azure Storage) without Asp
> .Net MVC 's outputcache with above infrastructure but this action is
> happening when i load the web site for the second time.
>
> The big problem is NHibernate SessionFactory adds almost 15 seconds to
> uptime of the project when it's first load and this is unacceptable.
>
> I have 25 entities and so their mappings actually, why it takes so much
> time for the first time?
>
> Here my configuration for Nhibernate
>
> public static ISessionFactory GetSessionFactory(){
>         return Fluently.Configure()
>        .Database(MsSqlConfiguration.MsSql2012
>        .Raw("connection.isolation", "ReadCommitted")
>        .ConnectionString("connectionString")
>        .Mappings(gX => gX.FluentMappings.AddFromAssemblyOf<MyEntity>())
>        .Cache(gX => gX.ProviderClass<SysCacheProvider>()
>        .UseSecondLevelCache()
>        .UseQueryCache())
>        .BuildSessionFactory();
>  }
>
> I don't have any problem of the create process of the SessionFactory by
> the way. The only problem is the up time of my project for the first time.
> I just solved many problems about with caching strategies but couldn't
> figured out the SessionFactory.
>
> Any idea or suggestion about it? Thanks
>
> --
> You received this message because you are subscribed to the Google Groups
> "nhusers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/nhusers.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/nhusers.
For more options, visit https://groups.google.com/d/optout.

Reply via email to