Hi,

I see in the Burrow faq that it works just with .Net 2.0.
1. Is it works now with .Net 3.5 and 4.0 also ?

2. For asp.net app I add a class that inherit IHttpModule to handle
the begin_request and end_request events. Is it good enough or it's
better to use burrow ?

 public class RequestHttpModule:IHttpModule
    {
        public void Dispose()
        {

        }

        public void Init(HttpApplication context)
        {
            context.BeginRequest += new
EventHandler(context_BeginRequest);
            context.EndRequest += new
EventHandler(context_EndRequest);
        }

        void context_BeginRequest(object sender, EventArgs e)
        {
            ManagedWebSessionContext.Bind(HttpContext.Current,
NHibernateHelper.OpenSession());
        }


        void context_EndRequest(object sender, EventArgs e)
        {
            ISession session =
ManagedWebSessionContext.Unbind(HttpContext.Current,
NHibernateHelper.SessionFactory);
            if (session != null)
            {
                if (session.Transaction != null &&
session.Transaction.IsActive)
                {
                    session.Transaction.Rollback();
                }
                else
                    session.Flush();

                session.Close();
            }
        }

    }


Thanks,

David

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

Reply via email to