Atozed Forums

Full Version: FireDac in Isapi.dll
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
IW 15.1.7

I have recently converted  DBExpress to FireDac in my web application.
Now almost every day the web application and my datasnap application freezes
and I have to stop start the web pools.


Today I remembered this:

"FireDAC is thread-safe, when the following conditions are meat:
A connection object and all associated with it objects (like TFDQuery, TFDTransaction, etc) in
each moment of time must be used by a single thread. FDManager must be activated before
threads will start by setting FDManager.Active to True."


Is it relevant in a ISAPI.dll? If so where do I put the code?

I have also attached a log message from my Isapi.dll witch I think is causing the problem
[attachment=190]
Yes its very relevant. All IW apps no matter the deployment method are threaded.

You need one per thread. You can use the UserSession or a datamodule that belongs to the usersession.
Ok bad news. Why did I changed to FireDac???

But isn't a thread already started when creating UserSession.
So what about this statement? FDManager must be activated before threads will start by setting FDManager.Active to True.

This is how I did it in a Service module
  FDManager := TFDManager.Create(nil);
  FDManager.ConnectionDefFileName := 'e:\FireDAC\FDConnectionDefs.ini';
  FDManager.ConnectionDefFileAutoLoad := True;
  FDManager.Active := True;

  StartThreads;  { Start file threads and begin fetching files }



Is that code ok, if so where should I put it. CreateUserSession?
Hi,

I just tested to drop a FDManager component on UserSession form.
It looked ok I tested several querys. But when I did Logoff  I got this error

Error message: [FireDAC][Comp][Clnt]-500. Application must have only single FDManager