Session provider - ResetItemTimeout called multiple times per page

Discussion in 'ASP .Net' started by =?Utf-8?B?Sm9uYXRoYW4gRHVrZQ==?=, Jan 24, 2006.

  1. I have written a custom session state provider that stores session data in
    XML in a SQL database [don't ask why], and I was running the SQL profiler to
    verify that all of my stored procedures were called in the correct
    situations. Each time I visited certain pages, I noticed that the SP called
    by the ResetItemTimeout method was called multiple times in a row.

    I have tracked this problem down to the point of the WebResource.axd module.
    It appears that the number of calls to ResetItemTimeout is equal to the
    number of times a resource from WebResource.axd is referenced within my page,
    such as for scripts and images. This specifically happens on pages where I
    am using the TreeView control or the Login control.

    Since there's no reason to have these extra hits on the database every time
    a resource is referenced by a control, I'm considering updating my session
    provider to simply skip the database call in ResetItemTimeout if
    Context.CurrentHandler is of the "System.Web.Handlers.AssemblyResourceLoader"
    type. However, I hate to hard-code something like that in. But after
    looking at the code for the SessionStateModule class in Reflector, I can't
    find any way other way to turn these unnecessary calls off.

    Am I doing something wrong or is this just a problem with the way .NET 2.0
    uses the AssemblyResourceLoader HTTP handler? It seems pretty excessive for
    it to be updating the expiration value that many extra times when it should
    already be updated when the main page is processed and it calls the GetItem
    method.

    I tested this using the default ASP.NET SQL Server sesssion state provider
    and see the same type of results. The dbo.TempResetTimeout procedure is
    called multiple times.
     
    =?Utf-8?B?Sm9uYXRoYW4gRHVrZQ==?=, Jan 24, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?TWFydGlu?=
    Replies:
    2
    Views:
    3,550
    T Saravana MMPatti
    Dec 16, 2011
  2. djskrill
    Replies:
    9
    Views:
    702
    djskrill
    Oct 1, 2003
  3. Apricot
    Replies:
    4
    Views:
    530
    velthuijsen
    Apr 16, 2004
  4. Radu
    Replies:
    7
    Views:
    716
    charlie_Stell
    Aug 28, 2009
  5. Felix
    Replies:
    1
    Views:
    345
    Felix
    Sep 29, 2006
Loading...

Share This Page