Groups | Blog | Home
all groups > dotnet component services > july 2003 >

dotnet component services : C# sharp not pooling component, Please help.


m3convertible NO[at]SPAM hotmail.com
7/19/2003 9:02:32 AM
I'm using windows2k and .Net framework 1.1

I created this test component with the following code:

using System;
using System.EnterpriseServices;
using System.Runtime.InteropServices;

namespace ASIC.IMS.Business.Library
{
/// <summary>
/// Summary description for Class1.
/// </summary>


[Transaction(TransactionOption.RequiresNew)]
[Synchronization(SynchronizationOption.Required) ]
[JustInTimeActivation(true) ]
[ObjectPooling(true, 5, 25) ]
[ClassInterface(ClassInterfaceType.AutoDual)]
public class cls_Testing : ServicedComponent
{
public cls_Testing()
{
//
// TODO: Add constructor logic here
//
}

[AutoComplete]
public byte DoTxAuto()
{
return(0);
}

protected override bool CanBePooled()
{
return(true);
}
}
}

The component registers without problems and I can see it from MMC
Component Services.
In the client I use the following VB.NET code to test pooling:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles Button1.Click
Dim i As Integer = 0

For i = i To 20
Dim o As New ASIC.IMS.Business.Library.cls_Testing()

o.DoTxAuto()
Console.WriteLine("HERE")
ServicedComponent.DisposeObject(o)
Next
End Sub


Everything works without errors but when I go to MMC Component
Services application - component folder on status view I don't see
anything under Objects, activated, pooled, in call, Call Time ms.

What am I doing wrong?

Please help!

Thanks 10x in advanced,

Tomas Restrepo (MVP)
7/19/2003 4:40:00 PM
Henry,

[quoted text, click to view]

Your problem has nothing to do with pooling. It's just that you're not
asking the COM+ runtime to keep track of that data. Either add the
[EventTrackingEnabled(true)] attribute to your classes, or do it later at
deploy time by setting the "Component Supports Events and Statistics" option
in the component's activation tab.


--
Tomas Restrepo
tomasr@mvps.orgs

AddThis Social Bookmark Button