Subject | Re: [firebird-support] FB 2.5 trace, read trace data with isc_info_svc_timeout |
---|---|
Author | Thomas Steinmaurer |
Post date | 2011-06-22T18:01:42Z |
> Im trying to use new trace API. I can start/stop trace service.I doubt using a timeout works here, because some kind of a GetNextLine
> I can read its output with isc_service_query but when there is no data left to read my app hangs and waits for data, so i decided i will add isc_info_svc_timeout param to the isc_service_query call. I use Delphi and IBX, i modified TIBCustomService.InternalServiceQuery to use timeout param but with no luck, I mean it looks like its ok, i can query trace data but when there is no more data my app still hangs and wiats for new data. What am I doing wrong?
call in case of using the trace service waits until the next line comes
along. You have to stop that trace session via another trace api
attachment. This will sind some kind of "end of message", which the
trace session receives and the trace Services API call is terminated.
<plug type=shameless>
You should give FB TraceManager a serious try, if you are in need for
using the trace API in a user-friendly way.
</plug>
--
With regards,
Thomas Steinmaurer
Upscene Productions
http://www.upscene.com
http://blog.upscene.com/thomas/
Download LogManager Series, FB TraceManager today!
Continuous Database Monitoring Solutions supporting
Firebird, InterBase, Advantage Database, MS SQL Server
and NexusDB!
>
>
> Modified IBX code i use:
>
>
> procedure TIBCustomService.InternalServiceQuery;
> var
> FTimeout: string;
> PTimeout: PChar;
> FTimeoutLen: short;
> begin
> //one second timeout
> FTimeout := Char(isc_info_svc_timeout) + Char(1) + Char(0);
> FTimeoutLen := Length(FTimeout);
> PTimeout := nil;
> IBAlloc(PTimeout, 0, FTimeoutLen);
> Move(FTimeout[1], PTimeout[0], FTimeoutLen);
>
> FQuerySPBLength := Length(FQueryParams);
> if FQuerySPBLength = 0 then
> IBError(ibxeQueryParamsError, [nil]);
> IBAlloc(FQuerySPB, 0, FQuerySPBLength);
> Move(FQueryParams[1], FQuerySPB[0], FQuerySPBLength);
> if (FOutputBuffer = nil) then
> IBAlloc(FOutputBuffer, 0, FBufferSize);
> try
> if call(FGDSLibrary.isc_service_query(StatusVector, @FHandle, nil,
> FTimeoutLen, PTimeout,
> FQuerySPBLength, FQuerySPB,
> FBufferSize, FOutputBuffer), False)> 0 then
> begin
>
>
>
> ------------------------------------
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Visit http://www.firebirdsql.org and click the Resources item
> on the main (top) menu. Try Knowledgebase and FAQ links !
>
> Also search the knowledgebases at http://www.ibphoenix.com
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> Yahoo! Groups Links
>
>
>