Question

I have a COM+ application written in C# (ServicedComponent.) The application pool size > 1 in all cases. I am using SharedPropertyGroups to retain and share data. From my testing it is not clear if all the running instances of the application is sharing the same values.

Are the properties stored in SharedPropertyGroup are shared across all the instances of the same COM+ application?

Was it helpful?

Solution

Each application pool (DLLHost process) will get it's own shared property manager. From COM+ Shared Property Manager Concepts:

"Shared properties stored in the SPM are available only to objects running in the same process."

So, the shared property manager will let you share transient state inside of one application (pool instance).

If you want to share state between multiple processes then you would probably want to look at an out of process cache approach (e.g. Windows Server AppFabric Caching or a database depending on the requirements).

Also see .NET Enterprise Services and COM+ 1.5 Architecture where they describe some of the issues when using application pooling:

Memory used by the Shared Property Manager (SPM) is process specific. Application pooling may impact any application that assumes it is using the only instance of the SPM on that machine. There is no longer any common highest-level data store (since components can span processes) for all instances of a COM+ component using application pooling. Alternatively, you can use a cached middle-tier database to store common state that will not only span instances in a process but processes as well. When doing this, you may want to consider using a pooled component that keeps a persistent connection to a database specifically for middle-tier serialization operations. In reality, this is a much better choice even without application pooling, due to the issues surrounding locking and performance of the SPM.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top