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
> Hi,
> If I have a class installed in COM+, which has class level private
[quoted text clipped - 12 lines]
>
> Steve
SteveL - 28 Jul 2005 10:20 GMT
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
> If both users call CoCreateInstance, both will get their own instance of
> this class - regardless of whether object pooling is enabled or not.
[quoted text clipped - 24 lines]
>>
>> Steve
Johannes Passing - 28 Jul 2005 20:38 GMT
The same scheme applies - if you do not use object pooling, you will not
receive a recycled (and thus, possibly 'dirty') object. If you do use
pooling, you should implement IObjectControl - or in case of ES,
overwrite ServicedComponent::Activate() and ServicedComponent::Deactivate().
/Johannes
> Thanks Johannes,
> What if the users are calling a web service that just instantiates the
[quoted text clipped - 47 lines]
>>>
>>>Steve