Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
FireDac in Isapi.dll
#1
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

.txt   wwd.txt (Size: 14.26 KB / Downloads: 3)
Reply
#2
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.
Reply
#3
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?
Reply
#4
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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)