3

I've written an ISAPI module in Delphi XE10 using pooled FireDAC connections. In the unit's finalization section, I have the code:

Finalization
  FDManager.Close;

The application freezes on the FDManger.Close line.

I have the Professional Delphi version which doesn't include FireDAC's source code, so I can't see why it's stuck, but whatever the reason, it's preventing IIS from shutting down.

I found this page

http://docwiki.embarcadero.com/RADStudio/Seattle/en/DLL_Development_(FireDAC)

that contains a section called FireDAC DLL Unloading that mentions that FireDAC can hang in DLL's. I tried the remedies mentioned there, but they didn't help.

The application doesn't hang if I don't use pooled connections.

Any suggestions?

Thanks,

Steve Kramer

Steve Kramer
  • 107
  • 6

1 Answers1

0

It seems that you must call "FDManager.Close" in an OnTerminate event: https://mathiaspannier.wordpress.com/2016/07/17/how-to-properly-cleanupshutdown-a-delphi-isapi-which-uses-threads/

bLight
  • 803
  • 7
  • 23