No COM+ Statistics?

For an exercise, I whipped up a simple little object that would be poolable in COM+

using System;
using System.EnterpriseServices;
namespace PooledObject
{
 public interface IGetData
 {
  string XmlString();
 }
 [ObjectPooling(Enabled=true, MinPoolSize=2,
 MaxPoolSize=5, CreationTimeout=20000)]
 public class Data : ServicedComponent, IGetData
 {
  private string sXML;
  public Data() : base()
  {
   sXML = "The Time is Now: " + DateTime.Now.ToString();
  }
  public string XmlString()
  {
   return sXML;
  }
  protected override bool CanBePooled()
  {
   return true;
  }
 }
}

I strong named it, ran regsvcs.exe to get it installed and generated the type library. I then started VB6, added a reference to the generated type library and created a few instances of this object. Everything worked fine. But when I go into Component Services (MMC), I don't see any statistics for the object! I know it's running and pooling properly. With a MinPoolSize of 2, after the first object is instantiated, asking for a second one produces the same time string returned from XmlString. I even single-stepped through the VB6 app and I don't get the spinning icon when the component is active. Anyone have any ideas?

1 Comment

  • You need to add this attribute:



    EventTrackingEnabled()



    to your Data class.



    This is turned off by default by the .Net serviced classes because it takes extra resources to show the "spinning balls".

Comments have been disabled for this content.