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:
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?