The factory session is already configured with the nhibernate.current_session key

NOTE. I also posted this on google google sites.

Description: An unhandled exception occurred during the execution of the current web request. View the stack trace for error information and where it originated in the code.

Exception Details: SharpArch.Core.PreconditionException: The factory session is already configured with the nhibernate.current_session key

Source Error:

Line 49: base.Init (); Line 50: Line 51: NHibernateSession.Init (new WebSessionStorage (this), Line 52: new line [] {Server.MapPath ("~ / bin / GCBA.Data.dll")}); Line 53:}

Source file: C: \ Users \ Matt \ Desktop \ Matt \ GCBA \ GCBA \ GCBA.Web \ Global.asax.cs Line: 51

Stack trace:

[PreconditionException: factory session is already configured with the nhibernate.current_session key]

SharpArch.Core.Check.Require (Boolean statement, string message) in C: \ MyStuff \ Projects \ SharpArchitecture \ SRC \ SharpArch \ SharpArch.Core \ DesignByContract.cs: 62

SharpArch.Data.NHibernate.NHibernateSession.Init (ISessionStorage repository, String [] mappingAssemblies, AutoPersistenceModel autoPersistenceModel, String cfgFile, IDictionary`2 cfgProperties, String validatorCfgFile \ Shurcchrchchchrctchrctchrctchrctchrctchrctchrctchrctchrctchrctchrctchrctchrctchrctchrctchrctchrctchrctchrctchrctchrctchrctchrctchrctchrctchrctchrctchrctchrctchrctchrctchrctchrctchrctchrarchrctchrarchrctchrctchrctchrarchrctchrctchrctchrctchrctchrctchrarchrctchrctchrctchrarchrctchrctchrctchrarchr .Data \ nHibernate \ NHibernateSession.cs: 70

SharpArch.Data.NHibernate.NHibernateSession.Init (ISessionStorage repository, String [] mappingAssemblies) in C: \ MyStuff \ Projects \ SharpArchitecture \ SRC \ SharpArch \ SharpArch.Data \ NHibernate \ nHibernateSession.cs: 26

GCBA.Web.MvcApplication.Init () in C: \ Users \ Matt \ Desktop \ Matt \ GCBA \ GCBA \ GCBA.Web \ Global.asax.cs: 51

System.Web.HttpApplication.InitInternal( HttpContext, HttpApplicationState, MethodInfo []) +335


, IIS7... , VS2008 .... , , 7/16/2009 trunk S # arp MVC.Net 1.0. , , global.asax.cs Init() . , , , - iis7 .

- , , , .

+3
3

. S # arp, - asp.net( cms). , Global.asax URL-. , HttpModule , , NHibernate, - . .

, ...

+1

, IIS7 ASP.NET MVC. , SO IIS7 ASP.NET MVC. SharpArchitecture IIS7 "" , .

0

, ?

- :

private static bool haveInit
if (!haveInit)
{
    lock (@lock)
    {
        if (!haveInit))
        {
            NHibernateSession.Init(...);
            haveInit = true;
        }
    }
}
0

Source: https://habr.com/ru/post/1715086/


All Articles