ObjectScope

3 posts, 0 answers
  1. Veronica
    Veronica avatar
    2 posts
    Member since:
    Nov 2008

    Posted 29 Dec 2008 Link to this post

    Hello Guys,

    I've got a problem switching a web project to SQLServer session state mode by reason of storing an object scope in session.
    In SQLServer mode ASP.NET serializes the session state and OpenAccess.RT.ObjectScope is not marked as serializable.
    I guess ObjectContainer can solve the problem.

    But can you answer: is it a sensible difference between getting a new object scope per a user session and getting a new object scope per Web.UI.Page class? (I'm interested in memory loading stats depending on number of sessions/pages open at the same time)

    Thanks in advance,
    V.

  2. Thomas
    Admin
    Thomas avatar
    590 posts

    Posted 30 Dec 2008 Link to this post

    Hello Veronica,

    our recommendation is that the ObjectScope should be opened/obtained based on demand by the page. The scope is a fairly light weight instance and fast to create. My personal recommendation is to use a getter property which obtains a scope when it had not been obtained before for this page (page field then, or master page field).
    The only difficulty is to Dispose() the scope when no longer needed, but this can easily be achieved in the overridden Dispose() of the page or master page.

    All the best,
    Thomas
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. DevCraft banner
  4. Veronica
    Veronica avatar
    2 posts
    Member since:
    Nov 2008

    Posted 30 Dec 2008 Link to this post

    Thanks for the recommendation! :)
Back to Top