Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Global application object is being reseted
Message
From
18/05/2007 12:24:32
 
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
VB 8.0
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01226327
Message ID:
01226823
Views:
27
To provide more information on the topic and to make sure I adjust properly where needed, here is what I have presently:

The Global.asax is like this:
<%@ Application Language="VB" %>

<object id="LXFramework" runat="server" class="Framework.Framework.App" scope="Application" />

<script runat=server>
    
    Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
        LXFramework.nApplicationMode = 3
        LXFramework.oServer = Server
        LXFramework.Initialize()
    End Sub

</script>
So, on the first hit to the Web site, the framework Initialize() is created. This is where all the settings are read.

Then, every page is inheriting from this Web form class:
Namespace Framework

    Public Class WebForm
        Inherits System.Web.UI.Page

        Public oProcess As Framework.LXProcess = New Framework.LXProcess()

        Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
            oProcess.oApp = Application.StaticObjects.GetObject("LXFramework")
            oProcess.oRequest = Request
            oProcess.oResponse = Response
            oProcess.oServer = Server
            oProcess.oPage = Me
            oProcess.BeginRequest()
        End Sub

        Sub Page_UnLoad(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Unload
            oProcess.EndRequest()
        End Sub

        Sub Page_Error(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Error
            oProcess.ErrorSetup()
        End Sub

    End Class

End Namespace
So, basically, on each hit, my Web site hit process object is created and I assign the framework application object to it. This line does it:
oProcess.oApp = Application.StaticObjects.GetObject("LXFramework")
But, as I mentioned, after a while, on a specific server, it gets lost. As you mentioned, this has to be enhanced with a static approach so it would reload by itself on the next hit following that reset.

But, I am not sure where exactly I need to apply the static constructor. Basically, what happens is that the Global.asax is read only once, where the Initialize() will be fired at first. And, then, when something is reseted on the server, this application object is destroyed but the Global.asax is not reloaded as it was already once. So, what would you recommend as far as changes go to resolve that issue?
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
Next
Reply
Map
View

Click here to load this message in the networking platform