Having trouble with COM+ Object Pool and Windows2003 Server

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Michael (Michael_at_discussions.microsoft.com)
Date: 06/22/04


Date: Tue, 22 Jun 2004 08:00:01 -0700

I have a COM+ object that only has 1 method. We have been running this object on Windows2000 Server for a year and it’s been working great. We port this to Windows2003 Server and we start to have issues. The object uses Object Pooling and is called from an ASP file. This is what the code looks like in ASP(3.0 not ASP.NET) to call the COM+ object

Set MyObject = Server.Create(“MyProdID”)
RetVal = MyObject.MyMethod()
Set MyObject = Nothing

Now, this has been working great for over a year on Windows2000 Server and also works on WindowsXP. Now, I’m able to create the object, get the return type but it seems to never put the object back into the pool, so every time I call my object, the activated objects seem to keep going up and never put back into the pool, so if I call the code above 5 times, after all 5 calls have returned, it will still have 5 activated objects. Seems like the only way to destroy the objects is to right click and pick shutdown from the menu. Under Windows2000 Server and WindowsXP, each time I do “Set MyObject = Nothing”, the object would go back into the pool, so after 5 calls and all 5 calls return I would have 0 activated objects. I’ve tried putting the attribute [AutoComplete(true)] by itself and it didn’t work, I’ve tried putting [AutoComplete(true)] with ClassInterface AutoDual and it didn’t work. I also tried [AutoComplete(true)] with ClassInterface AutoDispatch and that didn’t work either. I al
so have a dispose pattern which calls base.dispose passing disposing and it doesn’t work. I’m not sure what else to try?
I hope someone can help. Here are some of the attributes I have that are important
[assembly: ApplicationActivation(ActivationOption.Server)]
[assembly: ClassInterface(ClassInterfaceType.AutoDispatch)](also tried none and AutoDual)
[AutoComplete(true)] on my method
[InterfaceType(ComInterfaceType.InterfaceIsDual)](also tried InterfaceIsIDispatch) on my interface

[Serializable()]
[GuidAttribute("C9998500-65AD-4bb1-8E98-8B4B52C5ADB7")]
[JustInTimeActivationAttribute(true)]
[ObjectPooling(true, 10, 200)]
[MustRunInClientContext(false)]
[ProgId("MyProdId")]
[EventTrackingEnabled(true)]

And I am inheriting off ServicedComponent as well as my interface
    Michael