I am trying to integrate the geneva framework into the WCF Facility. I
have successfully created a custom channel builder and this is being
called correctly. As geneva attached the client claims set to the
channel we need the channels (i.e. proxies) to be transient. I have,
however found an issue with this configuration. The Instantiate method
on the WcfClientActivator is called to create the proxy, but it always
calls options.AddAdditionalInterface(typeof(IContextChannel)), meaning
that this collection grows by one each time. This means that each call
to create a proxy gets slower and slower as it has to process a
grwoing number of interfaces.

The following test will recreate the issue (test added to
WCFClientFixture):
[Test]
public void TestResolveLeaksIContextChannelInterfaces()
{
windsorContainer.Register(
Component.For<IOperations>()
.Named("operations")
.LifeStyle.Is(LifestyleType.Transient)
.ActAs(new DefaultClientModel()
{
Endpoint = WcfEndpoint
.BoundTo(new NetTcpBinding { PortSharingEnabled = true })
.At("net.tcp://localhost/Operations")
})
);

for (int i = 0; i < 5; i++)
{
IOperations client = windsorContainer.Resolve<IOperations>
("operations");
Assert.AreEqual(42, client.GetValueFromConstructor());
windsorContainer.Release(client);
}
}

I'm not sure how to expose the growing list of interfaces in the test,
but if you break on the line in WcfClientActivator.Instantiate
(CreationContext context) where it calls
options.AddAdditionalInterface you will see the collection growing.
You will also observe the call to windsorContainer.Resolve gets slower
each time. Change the test to have 50 iterations and it will get
extremely slow.

To me this looks like a bug in the code, but it could be that I am
using it incorrectly. Please can someone advise.

Thanks
Will

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