Hibernate version:1.2.1.4000
IIS version 7, .NET Framework 2.0
I want store ISession in HttpSession without closing it until one business process completes. But when I increase the worker process count, ASP.NET tries to serialize ISession object to state server and following exception occurs.
Note: I have enabled sessionState service and the web.config file contains <sessionState mode="StateServer"></sessionState>
The exception has been thrown in this line of code:
ISession _result = Session["HibernateSession"] as ISession;
Stack Trace:
[ArgumentNullException: Key cannot be null.
Parameter name: key]
System.Collections.Hashtable.get_Item(Object key) +2909973
NHibernate.Impl.SessionFactoryObjectFactory.GetNamedInstance(String name) +46
NHibernate.Impl.SessionFactoryImpl.GetRealObject(StreamingContext context) +56
System.Runtime.Serialization.ObjectManager.ResolveObjectReference(ObjectHolder holder) +61
System.Runtime.Serialization.ObjectManager.DoFixups() +2798521
System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage) +203
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage) +190
System.Web.Util.AltSerialization.ReadValueFromStream(BinaryReader reader) +790
System.Web.SessionState.SessionStateItemCollection.ReadValueFromStreamWithAssert() +54
System.Web.SessionState.SessionStateItemCollection.DeserializeItem(String name, Boolean check) +257
System.Web.SessionState.SessionStateItemCollection.get_Item(String name) +22
System.Web.SessionState.HttpSessionStateContainer.get_Item(String name) +10
System.Web.SessionState.HttpSessionState.get_Item(String name) +10
MultiWp._Default.get_HibSession() in D:\Development\Projects\Training\MultiWp\Default.aspx.cs:28
MultiWp._Default.Page_Load(Object sender, EventArgs e) in D:\Development\Projects\Training\MultiWp\Default.aspx.cs:22
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +33
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +47
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1436
|