Microsoft KB Archive/299719

= INFO: COM+ Pooled Components Should Not Hold Queued Component Recorder Objects =

Article ID: 299719

Article Last Modified on 12/5/2007

-

APPLIES TO


 * Microsoft COM+ 1.0
 * Microsoft COM+ 1.5

-



This article was previously published under Q299719



SUMMARY
Queued Component (QC) Recorder objects cannot be directly pooled and should not be wrapped in a COM+ pooled component.



MORE INFORMATION
Queued Component Recorder objects cannot be directly pooled in a COM+ object pool because you cannot modify the attributes of the QC.Recorder.1 component in the COM+ Utilities application.

In addition, you should not wrap a Recorder object in a COM+ pooled component for two reasons:
 * The Recorder object will not be able to participate in a transaction.
 * The Microsoft Message Queue Server (MSMQ) message is not sent until the Recorder object is deactivated. For typical pooled component implementations, this occurs only when the pooled object is released, which is during COM+ application shutdown. The MSMQ message is not sent at all if the COM+ application that hosts the pooled components failfasts or crashes unexpectedly.

If you need to wrap a QC Recorder object in a pooled object, select the Automatically deactivate this object when this method returns check box for your object methods. If you call a method with this check box selected, the current Recorder object is deactivated, and its corresponding MSMQ message is sent when the method call completes. Select this check box for those methods of the object whose completion should mark the end of a transaction or unit of work. These methods are the object methods that ordinarily contain calls to the SetComplete method. You must make sure that your pooled object calls these methods at the correct time. Failure to do so prevents the message from being sent.

