Repeating trying to create datamodule in FastCGI application lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- egsuh · 2024-11-08 08:04 I have written a FCGI application, with two Webmodules and one Datamodule. The Database is maintained in the DataModule, and WebModules handle requests. The skeleton structure of DataModule is as follows. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i type  Taqfb5 = class(TDataModule, IaqCommon, IDataCollection, IaqEdit)     fbAQ: TIBConnection;     trAQ: TSQLTransaction;     procedure DataModuleCreate(Sender: TObject);     procedure DataModuleDestroy(Sender: TObject);     // .....   end;  var   aqfb5 : Taqfb5; implementation procedure Taqfb5.DataModuleCreate(Sender: TObject);begin     log('creating');      fbAQ.Connected := True;      log('created'); end;  procedure Taqfb5.DataModuleDestroy(Sender: TObject);begin     log('destroyed'); end;      // ......................... initialization     log('initializing');      aqfb5 := Taqfb5.create(nil);  finalization     log('finalizing');    aqfb5.free; end.   The "log" procedure in above codes simply appends the string to a designated (text) log file. So I can read them. The key is, when I WRONGLY put Database name of fbAQ, which is an IBConnection, then this application repeats    initializing    creating    destroyed     initializing    creating    destroyed       ........ unfinished. When I changed the database name correctly the phenomenon disappeared. So... should I use try..except or try..finally block at the database connection? But what can I do if the DB is not connected? Sending out message "DB not connected" at every request? Hmmm...