This is a migrated thread and some comments may be shown as answers.

ObjectScope

2 Answers 98 Views
Development (API, general questions)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Veronica
Top achievements
Rank 1
Veronica asked on 29 Dec 2008, 06:29 PM

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 Answers, 1 is accepted

Sort by
0
Thomas
Telerik team
answered on 30 Dec 2008, 12:19 PM
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.
0
Veronica
Top achievements
Rank 1
answered on 30 Dec 2008, 12:48 PM
Thanks for the recommendation! :)
Tags
Development (API, general questions)
Asked by
Veronica
Top achievements
Rank 1
Answers by
Thomas
Telerik team
Veronica
Top achievements
Rank 1
Share this question
or