Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sharing of Tables object
Message
From
07/01/2011 02:46:45
 
 
To
All
General information
Forum:
ASP.NET
Category:
Other
Title:
Sharing of Tables object
Environment versions
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01495118
Message ID:
01495118
Views:
91
I have a oApp object which is shared across multiple worker process. It is defined like this:
        Public Shared oApp As Framework.App = New Framework.App()
In that class, I also have this definition:
        ' Data dictionary
        Public Tables As New Tables
I have four worker process defined in my application pool. So, when the Web site starts, all application pools will eventually get loaded. However, only the first one will load the data dictionary. There is a lock mechanism in place which makes it like that. So, once the first one executes this operation, once finished, all other worker process can see oApp.Tables collection.

This has worked ok for a few weeks. But, I just discovered something weird tonight.

Basically, at startup, one does the job of loading the data dictionary. And, as mentioned, because of a lock mechanism, this assure that only one does the job and initialize the oApp.Tables collection, which then become visible to the other three worker process. What I discovered tonight is if, later on, one worker process (one of the four worker process defined for the application pool of the Web site) updates oApp.Tables, the other ones will not see the change. This surprises me because I always had the assumption that the oApp shared object was taking care of sharing everything under it, which is the case at first with oApp.Tables. So, why does it work at first and, a change later on in it cannot be seen on the other worker process?
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
Next
Reply
Map
View

Click here to load this message in the networking platform