Thanks Johannes,
What if the users are calling a web service that just instantiates the
object and aren't calling coCreateInstance and the objects in COM+ do not
implement the IObjectControl interface. Long story but basically the only
reason that they are in COM+ is because company standards forced it on us at
the last minute. All our objects inherit from a base class and when we
build in release mode, conditional compilation, the base class inherits from
serviced component. They doesn't use any of the COM+ features, they are
just in there!
i.e.
In a method they are creating the class below:
myClass oClass = new myClass;
class myClass
{
private int _myVar;
}
Could they still get a dirty object?
Steve
[quoted text, click to view] "Johannes Passing" <johannes.passing@gmx.net> wrote in message
news:O2AOGOTkFHA.3936@TK2MSFTNGP10.phx.gbl...
> 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