{"This operation requires IIS integrated pipeline mode. - Nhibernate

1,345 views
Skip to first unread message

Ashwin

unread,
Mar 28, 2010, 6:09:30 PM3/28/10
to nhusers
I started using NHibernateSessionPerConversationModule.cs HttpModule
(http://www.summerofnhibernate.com/ ) which creates a session per
conversation ( and everytime there is a page request for some reason
the Application_BeginRequest gets fired twice. And it ends up throwing
the follwoing messages.

1) Object reference not set to an instance of an object.

When I dig deeper here is what i see in the follwoing error messages

base {System.NotSupportedException} = {"This operation requires IIS
integrated pipeline mode."}

CurrentNotification = 'HttpContext.Current.CurrentNotification'
threw an exception of type 'System.PlatformNotSupportedException'

Iam using Visual studio 2008 on my windows 7 laptop and IIS server
( Version 7.5.7600.16358 ) . Am not sure if I have to change any
settings in the integrated webserver of VS 2008.

Here is the code.

private void Application_BeginRequest(object sender, EventArgs e)
{
ISession currentSession =
(ISession)HttpContext.Current.Session[NHIBERNATE_CURRENT_SESSION_KEY];
if (currentSession == null)
{
currentSession = StaticSessionManager.OpenSession();
currentSession.FlushMode = FlushMode.Never;
}
CurrentSessionContext.Bind(currentSession);
currentSession.BeginTransaction();
}

private void Application_EndRequest(object sender, EventArgs
e)
{
ISession session =
CurrentSessionContext.Unbind(StaticSessionManager.SessionFactory);

if
(HttpContext.Current.Items[NHIBERNATE_CONVERSATION_END_FLAG_KEY] !=
null)
{
session.Flush();
session.Transaction.Commit();
session.Close();

HttpContext.Current.Session[NHIBERNATE_CURRENT_SESSION_KEY] = null;
}
else
{
session.Transaction.Commit();

HttpContext.Current.Session[NHIBERNATE_CURRENT_SESSION_KEY] = session;
}

}

Robert Rudduck

unread,
Mar 28, 2010, 6:44:49 PM3/28/10
to nhu...@googlegroups.com
Just change the app pool in IIS to use the Integrated Pipeline instead of the classic pipeline. This also may necessitate some changes to your web.config file as well (adding a webserver section and moving the modules under there IIRC).

http://www.west-wind.com/Weblog/posts/168221.aspx

- Robert


--
You received this message because you are subscribed to the Google Groups "nhusers" group.
To post to this group, send email to nhu...@googlegroups.com.
To unsubscribe from this group, send email to nhusers+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.


Ashwin

unread,
Mar 28, 2010, 6:56:51 PM3/28/10
to nhusers
Thanks Robert you saved me !!!

Thanks a million , I no longer get that error. :)

On Mar 28, 6:44 pm, Robert Rudduck <rob...@rpowered.net> wrote:
> Just change the app pool in IIS to use the Integrated Pipeline instead of
> the classic pipeline. This also may necessitate some changes to your
> web.config file as well (adding a webserver section and moving the modules
> under there IIRC).
>
> http://www.west-wind.com/Weblog/posts/168221.aspx
>
> - Robert
>
>
>
> On Sun, Mar 28, 2010 at 5:09 PM, Ashwin <ash.shas...@gmail.com> wrote:
> > I started using NHibernateSessionPerConversationModule.cs HttpModule

> > (http://www.summerofnhibernate.com/) which creates a session per

> > nhusers+u...@googlegroups.com<nhusers%2Bunsu...@googlegroups.com >

Reply all
Reply to author
Forward
0 new messages