Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: turning off TFDCustomManager ??


This question is answered.


Permlink Replies: 2 - Last Post: Jun 26, 2017 10:53 AM Last Post By: Maxime Bonin Threads: [ Previous | Next ]
Maxime Bonin

Posts: 61
Registered: 1/23/17
turning off TFDCustomManager ??  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 22, 2017 2:44 PM
I am working on Delphi XE8 with a Microsoft SQL Server Express 2014

Question : is there a way to disable TCustomManager ?

We moved from an application sharing the same connection (TFDConnection- MSSQL driver) to using several dozens connections.

All connections are temporary (http://docwiki.embarcadero.com/RADStudio/Tokyo/en/Defining_Connection_(FireDAC)

nevertheless TFDCustomManager (singleton FDManager) is keeping tabs on connections and datasets within connections. When the application closes and the CustomManager gets freed : we get two errors.

The first one is an InvalidTypecast :

upon finalization, TFDCustomManager releases the Datasets from the connections. But on some connections, the Dataset has already been freed : and the classname of the object in the Datasets List is a TFreedObject, hence the typecast error between TDataset and TFreedObject.

The second error pops up a couple of seconds after the application is shut down. It is a TimeOut error coming from the CustomManager saying that all connections have not been released.

Since we actually had defined our TFDConnection to be 'Temporary' and we take responsability of freeing our connections after use, is there anyway to disable TCustomManager from the get go ?

(I'm currently unable to post code snippets since I will be away from my workstation for a few days...)
Dmitry Arefiev

Posts: 1,406
Registered: 12/7/03
Re: turning off TFDCustomManager ??
Correct
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 23, 2017 10:18 PM   in response to: Maxime Bonin in response to: Maxime Bonin
You cannot disable TFDManager, because it is critical part of FireDAC.
From what I see the problem may be somewhere in your application and related to object live cycle management.
Or it may be some FireDAC bug, which probably is already fixed. Try to compile your application with DX 10.2.

--
With best regards,
Dmitry
Maxime Bonin

Posts: 61
Registered: 1/23/17
Re: turning off TFDCustomManager ??  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 26, 2017 10:53 AM   in response to: Dmitry Arefiev in response to: Dmitry Arefiev
After a little debugging I was able to fix the issue. It wasn't really a probleme of live cycle management, but an issue in our codebase. My guess is that when we opened a dataset, it created a new connection with a new dataset and left the original dataset half-dead in the former connection.

Dmitry Arefiev wrote:
You cannot disable TFDManager, because it is critical part of FireDAC.
From what I see the problem may be somewhere in your application and related to object live cycle management.
Or it may be some FireDAC bug, which probably is already fixed. Try to compile your application with DX 10.2.

--
With best regards,
Dmitry
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02