Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Component Services / July 2003

Tip: Looking for answers? Try searching our database.

C# sharp not pooling component, Please help.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
MrPolo - 19 Jul 2003 17:02 GMT
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,

Henry Y
Tomas Restrepo \(MVP\) - 19 Jul 2003 22:40 GMT
Henry,

> 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?

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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.