Its not scientifically tested, but the first tries with the following
Base-Class for Pages were successfull:

public class BasePage : System.Web.UI.Page
{

        public override void ProcessRequest(System.Web.HttpContext context)
        {
                using (Database.Current.StartSession())
                {
                        base.ProcessRequest(context);
                }
        }

}

Greetings!
Zorgoban

On 3 Mrz., 17:38, Angel Java Lopez <[email protected]> wrote:
> Hi people!
>
> Great thread! (pun intended.. :-)
>
> I guess we need an explicitly documented behaviour by Microsoft about
> "thread agile": the change of the thread in the SAME request. I agree, Pier
> blog post is the best link in this discussion, but I'm curious about some
> "official" doc about the topic.
>
> In Java/Tomcat world, ThreadStatic is used for keep Hibernate stuff. No
> change of thread in the SAME request.
>
> Any link?
>
> Angel "Java" Lopezhttp://www.ajlopez.comhttp://twitter.com/ajlopez
>
> On Wed, Mar 3, 2010 at 4:42 AM, Zorgoban <[email protected]> wrote:
> > I dont like how this Hanselmann states his personal opinion as fact
> > without really explaining the backgrounds. He absolutely lost my
> > respect when simply calling ThreadStatic evil, but stating
> > Thread.AllocateNamedDataSlot as good solution, while this is
> > eventually the same thing. Its even written in the Documentation to
> > use ThreadStatic instead of Thread.AllocateNamedDataSlot for better
> > performance.
>
> > The link Robert Rudduck posted earlier handled this issue much more
> > scientific and actually tells you exactly where the problems lie. You
> > will implicitly learn how to avoid those problems. Its a fact that I
> > have to store the data in the context of a Thread, because of reasons
> > I mentioned earlier. But still, if anyone can think of a better
> > solution I will be gladly analysing it.
>
> > For now im still stuck with ThreadStatic and writing a documentation
> > that explains how to use it in ASP.Net.
>
> > Greetings!
> > Zorgoban

-- 
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