Home All Groups Group Topic Archive Search About

FIFO policy in SessionPageStatePersister

Author
22 Oct 2007 3:25 PM
John Wang
With in .NET 2.0 framework, SessionPageStatePersister class is provided to
be an option of ViewState persister. After turned to it, we found most users
lost their ViewState objects while they were busy to click the links in aspx
form. With tracing the application text log, we found the session is OK, not
expired. It confused us a long time.

After analyse the SessionPageStatePersister, following codes shock us,

                SessionPageStateSection sessionPageState =
RuntimeConfig.GetConfig(base.Page.Request.Context).SessionPageState;
                int count = queue.Count;
                if (((sessionPageState != null) && (count >
sessionPageState.HistorySize)) || ((sessionPageState == null) && (count >
9)))
                {
                    string name = (string) queue.Dequeue();
                    session.Remove(name);
                }

It means that the class is holding a FIFO queue with limited quota. If quota
exceeded, viewstate of the 1st page will be discarded. For example, if the
limitation, which is a configuration in web.conf, historySize property in
sessionPageState node, is little or equal to the default value 9; a repeater
or a gridview in a web form, and each action is showing a new popup window,
after 9 windows shown, we return to the web form and post a self-window
submission, what's the result?
As you know, it failed to response the clicks, because the viewstate in the
page with the web form in was discarded.

Does any experts reach the case? Please advise the solution.

Thanks & Regards,

John Wang

AddThis Social Bookmark Button