Re: Stateless objects



If both users call CoCreateInstance, both will get their own instance of this class - regardless of whether object pooling is enabled or not.

If you are using pooling, the client may get a recycled instance - thus, it is your duty to clear all member variables when implementing IObjectControl to avoid another client retrieving a 'dirty' object.

In any case, you should be very careful with storing data in member variables if you are using transactions...

/Johannes

SteveL wrote:
Hi,
If I have a class installed in COM+, which has class level private variables, can the values be exposed to other users of the class if object pooling is not enabled.


For example class 1 is used by UserA and a private variable is set in the class. If UserB is using the same class is there a danger that UserB will be using values set by UserA or do they instantiate their own instance of the class.

If object pooling is turned off, does this mean that this can never happen or do I need to completely remove all my class level variables?

Appreciate your help.

Steve


.



Relevant Pages

  • Re: COM Interop and memory leaks
    ... I must use COM+ object pooling through ... Then handler instances in pool will be deactivated when IE ... with managed object pooling I mean you have to do your ... >>RegisterNameSpace. ...
    (microsoft.public.dotnet.framework.interop)
  • Re: Slow performance after restarting
    ... I don't think it's a network issue, this happens all on a single box. ... (Although I think I get the same effect when the QA client is on a different ... Changing connection pooling settings ...
    (microsoft.public.sqlserver.programming)
  • Re: New Object Pooling project
    ... >I've released a beta of my Object Pooling software and it's freely available ... >This is an extensible Object Pooling system that could be extendend to ... PoolingDataSource dataSource ...
    (comp.lang.java.softwaretools)