Sorry for the enormous delay. I was abducted by a very big project and had to hibernate....
Now I'm back to this issue. I came here looking for a statefull implementation of FastCGI in pascal. FCGIApp.pas was exactly what I needed.
The problem I mentioned before can be exemplified like this. Suppose that...
1) User A makes a request and FCGIApp creates FCGIThread 1. Lets call it as FCGIThread1
2) Same user A makes another request and FCGIApp creates FCGIThread2. FCGIThread2.Execute method calls FCGIThread1.HandleRequest (throught _CurrentFCGIThread).
Calling a thread method (FCGIThread1.HandleRequest) inside another thread (FCGIThread2) does not change thread context. This leaves to some problems. For me the problem is that I'm using dbexpsda SQL Server driver and it needs a call to CoInitialize that has to be done inside thread context.
I have no ideas how to handle this issue. Tried several approaches without success.
If someone could give me a north I really appreciate!