Are you disposing and closing the service?Are you disposing the com
component?

On Wed, Nov 5, 2008 at 7:10 PM, Callum Hibbert <[EMAIL PROTECTED]>wrote:

> Hello,
>
> I am using a third party product for which I have written a plugin. My
> plugin is executed using COM, so I have something like this (very simple
> example):
>
>     [Guid("my-guid")]
>     [ClassInterface(ClassInterfaceType.None)]
>     [ProgId("myProgId")]
>     [ComVisible(true)]
>     public class MyPlugin : ICustomActivity
>     {
>         private readonly IMyWcfService service;
>
>         public MyPlugin()
>         {
>                 service = Container.Resolve<IMyWcfService>();
>         }
>
>         public string Execute(string xml) // This is the ICustomActivity
> implementation
>         {
>                 string response = service.DoSomething();
>                 return message;
>         }
>     }
>
> "Container" is a very simple wrapper around WindsorContainer. I am using
> the WCF Integration facility so the "service" object is a WCF service
> proxy/client. I have marked the object as transient, for example:
>
> <castle>
>     <components>
>         <component
>             id="IMyWcfService"
>             type="Company.Product.IMyWcfService, Company.Product"
>             wcfEndpointConfiguration="MyWcfServiceClientEndpointConfig"
>             lifestyle="transient" />
>     </components>
> </castle>
>
> My problem is that the "service" client is not being closed. If I run my
> application under load, I hit the maximum 10 open connections and then start
> to get errors for subsequent connections. I am unwilling to configure an
> increase in the number of allowed connections because this would be hiding
> the underlying problem.
>
> I have used Castle's WCF Integration on a lot of projects before and I have
> not experienced this problem, though this is the first time COM has ben
> thrown into the mix.
>
> Obviously, I have no hook to IDisposable. IMyWcfService does not implement
> IDisposable (and imy understanding is that you should never do that). Also,
> I cannot cast the proxy to IDisposable as a work around.
>
> Can anyone shed any light on what the problem might be? Is this something
> to do with the fact that the plugin is called via COM and is not disposed of
> correctly? How can I ensure the client is closed and disposed properly (and
> in a timely manner)?
>
> Any help or pointers greatly appreciated.
>
> Thanks,
>
> Callum
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to