Hello.
I need some help in order to understand contexts. The article at
http://www.gotdotnet.com/team/xmlentsvcs/espaper.aspx says that a
context is an environment for objects with similar execution
requirements. If I have two serviced components with exactly the same
attibutes defined, will they have the same context? Is this context
generated for components at the same COM+ application or can
components in different COM+ applications have the same context?
Sorry, but the MS docs seems rather confusing for newbies, I think.
Thanks,
Robert Scheer
Tomas Restrepo \(MVP\) - 03 Jan 2004 02:22 GMT
Hi Robert,
> I need some help in order to understand contexts. The article at
> http://www.gotdotnet.com/team/xmlentsvcs/espaper.aspx says that a
> context is an environment for objects with similar execution
> requirements. If I have two serviced components with exactly the same
> attibutes defined, will they have the same context?
Nope, not necessarily. Some attribute values for creation of the object on a
new context. Also notice that when one says that the components might share
the same context, that's not exactly true. Rather, object instances might
share the same context if the attributes allow it AND they are created in
the same execution line (that is, if they are not created during the same
calling stack, invocation or whatever you want to call it, they won't share
context).
> Is this context
> generated for components at the same COM+ application or can
> components in different COM+ applications have the same context?
Context is an in-process structure. It can be shared by two components in
different applications IF they are created inside the same process (so for
example, a server and a library app would do).

Signature
Tomas Restrepo
tomasr@mvps.org
Tomas Restrepo \(MVP\) - 03 Jan 2004 02:25 GMT
Hi Robert,
> I need some help in order to understand contexts. The article at
> http://www.gotdotnet.com/team/xmlentsvcs/espaper.aspx says that a
> context is an environment for objects with similar execution
> requirements. If I have two serviced components with exactly the same
> attibutes defined, will they have the same context?
Nope, not necessarily. Some attribute values for creation of the object on a
new context. Also notice that when one says that the components might share
the same context, that's not exactly true. Rather, object instances might
share the same context if the attributes allow it AND they are created in
the same execution line (that is, if they are not created during the same
calling stack, invocation or whatever you want to call it, they won't share
context). *
> Is this context
> generated for components at the same COM+ application or can
> components in different COM+ applications have the same context?
Context is an in-process structure. It can be shared by two components in
different applications IF they are created inside the same process (so for
example, a server and a library app would do).
* I guess I'm not sure how to express it nicely without bringin in some
extra COM+ concepts that would make it somewhat complicated...
You should definitely pick up a copy of Tim Ewald's "Transactional COM+"
book, since it explains all this in very much detail.

Signature
Tomas Restrepo
tomasr@mvps.org