My WCF Service, written in .NET 4.0, has a problem that the second, or any other call get stuck. The WCF Service does nothing else than calling a COM Object written in Delphi XE. The threading model is set to Both, the InstanceContextMode of the service is set to PerCall. The object does not much more than BSTR DoRequest(BSTR Request). I use Marshal.ReleaseComObject, but read in an article this is not a good way to clean up com objects; i tried it also without.

I tried the following things:

  • added logging to see where the WCF service is stuck. It is inside the COM call.
  • added a unhandled exception handler, but there are no exceptions.
  • checked if the Delphi Object uses Static variables
  • tried to compile with Delphi XE2 (maybe a bug in the delphi com libraries)
  • tried the Object with a multithreaded Delphi stress test tool to see if the problem is the same, but it worked nicely.
  • tried the object with a C# console stress test tool and got the same behaviour as in the WCF Service.
  • added a lock object around creating the Object, doing the call and destroying the Object. This did not help.
  • tried to create a new thread inside the WCF and set the threading model to STA; set the Delphi Object Threading Model to Single. This did not help.
  • tried to run the Object in the COM+ Services; this did not help.
  • checked the WCF throttling, this is set to 100
  • checked max connections of the service (this is for sure com related)

running out of ideas, please help :-)

link|improve this question

feedback

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
or
required, but never shown

Browse other questions tagged or ask your own question.