G
Guest
I've a question about globa variables lifetime in an asp.net app.
I've declared this class:
Public Class Utils
Private Shared _FcdDataManagement As FCD.DataManagement
Public Shared ReadOnly Property FcdDataManagement() As FCD.DataManagement
Get
If _FcdDataManagement Is Nothing Then
_FcdDataManagement = New FCD.DataManagement
End If
Return _FcdDataManagement
End Get
End Property
End Class
I think the variable may be nothing at the first call of each page
execution. But I've seen that the variable is nothing only for the first call
of the application. Then if I reload the page (=new execution) the variable
is not nothing. Why? I think each page execution pipeline is isolated from
others (otherwise why Application state?), but this behavior is quite
strange...
thanks
I've declared this class:
Public Class Utils
Private Shared _FcdDataManagement As FCD.DataManagement
Public Shared ReadOnly Property FcdDataManagement() As FCD.DataManagement
Get
If _FcdDataManagement Is Nothing Then
_FcdDataManagement = New FCD.DataManagement
End If
Return _FcdDataManagement
End Get
End Property
End Class
I think the variable may be nothing at the first call of each page
execution. But I've seen that the variable is nothing only for the first call
of the application. Then if I reload the page (=new execution) the variable
is not nothing. Why? I think each page execution pipeline is isolated from
others (otherwise why Application state?), but this behavior is quite
strange...
thanks