TFDMoniFlatFileClientLink irregularly does not trace to file

泄露秘密 提交于 2020-01-05 06:33:18

问题


I have a TFDMoniFlatFileClientLink on a form, filename set to d:\temp\monitor.txt, tracing=true, TFDConnection.Params.MonitorBy=mbFlatFile. This sometimes works and sometimes does not trace anything. No file gets created.

Tested with Win7 32-bit app, with design time TFDConnection to either FireBird or Oracle. Delphi Tokyo 10.2.1

What is going on?


回答1:


This was a really weird bug:

It turns out that the TFDMoniFlatFileClientLink remembers the filename when removed and placed back, then does not trace.

To reproduce:

Remove the TFDMoniFlatFileClientLink, optionally save the project, place a TFDMoniFlatFileClientLink on the form again, set tracing=true. It has magically remembered filename d:\temp\monitor.txt (where?), then either does not trace or traces to C:\Users\username\AppData\Local\Temp\traceX.txt.

Only when you change the filename does it successfully trace again.*

Similar weird things happen with TFDMoniRemoteFileClientLink, it very often does not create trace output for FDMonitor to pick up. I have not investigated the exact conditions under which this happens.

I found this in a test app after tracing the following issue, possibly related:**

A design time TFDConnection gets its parameters filled at run-time. I executed TFDConnection.Params.Add('MonitorBy=mbFlatFile') but the app did not trace. I verified that MonitorByInitial=true at run-time. Params.Add('MonitorBy=mbRemote') also failed.
A TFDMoniFlatFileClientLink and TFDMoniRemoteClientLink were placed on the datamodule at design time.

Reported in Embarcadero Quality Portal under issue RSP-19554

* Even if you change it to the same file name. If you do that at run-time you have to set Tracing=false/true around the FileName assignment.

** Mmm, not related. Reported as RSP-19559



来源:https://stackoverflow.com/questions/47831043/tfdmoniflatfileclientlink-irregularly-does-not-trace-to-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!