My app is a web server that handles requests in threads. Eacht thread has its own connection that shoold be pooled. The DB coe looks like this:
Code: Select all
begin
FDBCon := TMSConnection.Create(nil);
try
FDBCon.Server := FServer;
FDBCon.Database := FDatabase;
FDBCon.Username := FUser;
FDBCon.Password := FPassword;
FDBCon.Pooling := True;
FDBCon.PoolingOptions.ConnectionLifetime := 60000;
// create query and do stuff qith query / FDBCon
finally
FDBCon.Free;
end;
end;
Code: Select all
OLEDBAccess.TOLEDBConnection.Disconnect
CRConnectionPool.TCRLocalConnectionPool.InternalFreeConnection($40FA640,False)
CRConnectionPool.TCRLocalConnectionPool.Clear
CRConnectionPool.TCRLocalConnectionPool.Destroy
System.TObject.Free
MemUtils.TDAObjectList.Notify($3D02DE0,lnDeleted)
System.Classes.TList.SetCount(0)
System.Classes.TList.Clear
CRConnectionPool.TCRConnectionPoolManager.InternalClear
CRConnectionPool.TCRConnectionPoolManager.Destroy
System.TObject.Free
MSConnectionPool.Finalization
How should I implement the lifecycle for a TMSConnection in a pooled situation?