Describe this first. "errors" is too broad.
I think so, too. The "Connected:= True" code should be in a "Try...Except..End;" frame, in order to log the connection settings used.
cgi is single threaded perhaps fastcgi is not.
Perhaps.
A multi-threaded database application - for 1 web user - means that the web connection (of the said user) can have several SQL-database-sessions-connections (the so called multi-threaded side; but without TThread
).
I'm doing a quick analysis: if fastCGI (over CGI which is "wkOneShot") is indeed a multi-threaded technology (said "wkSession", over "wkPooled"),
in addition to being persistent in RAM ("wkPooled"), then fastCGI should also be able to manage (for the same Web user session), several SQL sessions in parallel.
Based on what modalities?
• At the T{fp}Database: this already requires that a TWebModule is always loaded in memory: creating multiple database connections of a TWebModule seems presumptuous.
Feasible nevertheless, storing the created TDatabases-connections points in a container like T{fpSessions}List. All TDatabase instances created should have (for an ease of use) their properties like KeepConnexion, DatabaseName, connection parameters (e.g. transIsolation=read-commited, ...) in an identical way (
put it another way: create a T{Generic or not}List containing the sessions-connections-on_the_database, created to iterate (with Foreach a.k.a. "For..in", or simple For) the previously said TDatabases, in order to assign them the same properties KeepConnection, DatabaseName, etc, in an identical way).
• Now, before we "get down" to the TDatabase level, already, amho, just being able to configure the creation of parallel instances of the same TfpWebDatamodule - with code that would at least always leave one instance loaded in RAM, even after the web user session has ended - that could be created several times per "wkSession" (for the same web user session), would have the merit to exist.
And it would delegate the problem of code specific for such or such database to each fpWeb user.