Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Major mixup in two ASP.NET transactions
Message
From
04/09/2006 17:10:05
 
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
VB 8.0
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01150471
Message ID:
01150785
Views:
39
>You don't want to go thorugh all of this. A static property hung off an object somewhere will let you keep a single instance of your oApp object around. You don't want to require a special page class just to recreate this object - you should should treat the oApp object as a singleton which is going to be much more efficient resulting in smaller memory footprint (no objects created over and over for every hit).
>
>Performance is probably not a big concern if hte instantiation is pretty light weight, but if you're doing things like reading settings from an INI (as you mentioned earlier) file you surely don't want to do that on every hit!
>
>Actually looking at this a little closer - a static won't work if you're assigning request specific items to this object. Why are you even storing Request and Response? Those objects are ALWAYS available with:
>
>HttpContext.Current.Response
>HttpContext.Current.Request
>
>from anywhere where HttpRequest/httpResponse are visible.
>
>There's no need (in fact it a bad idea because the object reference may keep the garbage collector from cleaning up the references if your code fails to clean up its object) to save those vars.

I will reply to the other message you just sent with all the related information.

Thanks
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Reply
Map
View

Click here to load this message in the networking platform