TIBCSQLMonitor

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Comed
Posts: 7
Joined: Mon 23 Mar 2015 13:19

TIBCSQLMonitor

Post by Comed » Mon 23 Mar 2015 13:45

Hello,

is it possible to disable the monitor just for some objects?

We have an application that dynamically creates IBCQuerys. And we use the IBCSQLMonitor.OnSQL to log all things. So far so good.

But if we try to Use another IBCQuery with an extra IBCConnection to log the Text into a Database the problems start. Database-Exceptions,Subcomponents like Params.create, DB-Events etc. end up in an infinite loop which kills after some Time the hole application (Max List-Index or No Memory available);

So An Option e.g. like "IBCConnection1.EnableMonitoring:=False" disable the OnSQL Event for all Objects that Use IBCConnection1 would be helpfull.

Code: Select all

procedure TDataBaseDataModule.IBCSQLMonitor1SQL(Sender: TObject; Text: string;
  Flag: TDATraceFlag);
  var l:string;
begin
      //This code is kind of dirty. And we don't like to Use it like this. 
      // Database-Exceptions are catched here and Ended in an Infinity-Log-Loop 
      // Some Kind of IBCQuery.Monitoring:=False (Default: True) would be helpfull  
      try
         l:='';
         if Sender.ClassType = TIBCConnection then 
              l:='TIBCConnection:'+TIBCConnection(Sender).Name else
         if Sender.ClassType = TIBCTransaction then 
              l:='Transaktion:'+TIBCTransaction(Sender).DefaultConnection.Name else
         if Sender.ClassType = TIBCQuery      then 
              l:='TIBCQuery:'+TIBCQuery(sender).Name else
         if Sender.ClassType = TIBCStoredProc then 
              l:='TIBCStoredProc:'+TIBCStoredProc(Sender).Name
         else l:='TComponent:'+TComponent(Sender).Name;

         if Pos('DBLog',l)>0 then Exit;
      except
         on e:exception do
         begin
             //nothing special for now
         end;
      end;

//     if _Konfiguration.isSQLProtokoll then
    case Flag of
//      tfQPrepare: ;
//      tfQExecute: ;
//      tfQFetch: ;
      tfError:   LogIntoDBandFile(ltError,feSQL,Text,now,True); 
//      tfStmt: ;
//      tfConnect: ;
//      tfTransact: ;
//      tfBlob: ;
//      tfService: ;
//      tfMisc: ;
//      tfParams: ;
//      tfObjDestroy: ;
//      tfPool: ;
      else  LogIntoDBandFile(ltInfo,feSQL,Text,now,True);
    end;
end;

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: TIBCSQLMonitor

Post by ViktorV » Tue 24 Mar 2015 13:44

Unfortunately, at the moment, TCustomDASQLMonitor does not support this functionality. If you want us to implement the feature, please post it at our user voice forum: https://devart.uservoice.com/forums/104 ... 909-common. If the suggestion gets a lot of votes, we will consider the possibility to implement it.

Comed
Posts: 7
Joined: Mon 23 Mar 2015 13:19

Re: TIBCSQLMonitor

Post by Comed » Tue 24 Mar 2015 15:25


ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: TIBCSQLMonitor

Post by ViktorV » Wed 25 Mar 2015 14:01

Feel free to contact us if you have any further questions about IBDAC.

Post Reply