Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8037993
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T03:05:23+00:00 2026-06-05T03:05:23+00:00

My WCF Service, written in .NET 4.0, has a problem that the second, or

  • 0

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 and set to MaxInt

the COM DLL is 32 Bit, so my VStudio Project Settings restrict to x86. I run on Windows 2008 R2. Maybe this does matter: The Delphi COM Object loads a C++ DLL, which might not be treadsafe.

I used Reflector + Dennis Bauer FileDisassembler to decompile the generated COM Wrapper. I dont see any special in it.

Using Windebug seems not very easy, as Delphi does not support PDB Files.

running out of ideas, please help 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T03:05:25+00:00Added an answer on June 5, 2026 at 3:05 am

    I added a critical section around all calls to the third party dll inside the delphi code.
    It looks like it is working now. This does not explain the behaviour of the com object, but now it seems to work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written a .NET Windows service which has a WCF service built into
We have an windows service written in .net, that is hosting WCF service. My
I have written a simple WCF service that accepts and stores messages. It works
I have written a very simple WCF service, that worked fine (code below), then
I have written a WCF service (I am a newb) that I want to
That's a horrible title, sorry. Here's the scenario: WCF Service uses LINQ to get
I have a WCF service that does some document conversions and returns the document
I have a WCF service written in .NET 4.0 running on Windows 2008 R2
I've written a custom Role Provider for ASP.Net MVC. I'm calling a WCF service
I am working on a distributed solution (written in .NET) that includes WCF services,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.