I want only one instance of a Com+ Server Object running and various clients accessing concurrently the same instance. How can i create this in .Net ?
Hi, If you want to use COM+ it's not necessarily a good idea to have statefull components, so instead of having only one instance of a specific component it might be better to have multiple instances of a component that access the same 'shared' data. If you use the SPM (shared property manager part of COM+) or SQL server as data repository, the mechanics to get synchronization on accessing your data is already part of those (and very optimized for usage in multi threaded scenarios). Now if you want to use COM+ only as a surrogate process for a singleton COM component I guess it can be done but I never tried to look at what was needed to achieve that. Anyway as far as synchronization is concerned or you use the SPM (becarefull the SPM might not be the best solution for all scenarios, locks are on property groups and I seem to remember you need to lock the data for reading also) or SQL and then you get the advantages of the locking scheme implemented in those products or you will have to manage it yourself with critical sections or any other w32 object that can be used for synchronization (semaphore, events...). Hope this help, have a good day and a good week, guillaume
The point is that i'm trying to create an out-of-process Server in a MTA that receives calls from various clients , and each call is executed in a different thread , I know that i have to used locks mechanisms , but that's what i want to do , so my question is : Is there any way to create a single instance that make this ?
Don't see what you're looking for? Try a search.
|