Join 34,000+ subscribers and receive articles from our blog about software quality, testing, QA and security.
 

Dataset logger revisited


#1

Hi there,

It looks like the logging of a dataset still influences the way the data is retrieved afterwards.

I found that after logging a dataset the record pointer IS pointing at the first record (a ‘while not eof’ loop iterates the expected numer of times). The data that is returned however, is not as expected.

The pattern I found is that the data returned alternates between the content of the last and the next-to-last record.

I’m using an IBQuery object to execute the SQL that returns the result set.

Any thoughts?

Gerben


#2

Hello Gerben,

thanks for reporting the problem. We are taking a look at it right now and I let you know when we have a solution.


#3

Hello again,

we built a test scenario with the Interbase components in combination with Firebird 1.5 and were unfortunately unable to reproduce the problem. It would be great if you could tell us the version numbers of the Interbase/Firebird server and client you are using.


#4

Hello Tobias,

I’m using “Interbase SQL Server for Windows”, version “WI-V7.5.1.80”. I’m using the default Interbase components form the “Interbase” tab in the Delphi IDE. I hope this helps.

Gerben


#5

Hello Gerben,

I’m still unable to reproduce the problem. I’ve tested it with different versions (Interbase WI-V7.5.0.129 and WI-V7.5.1.80, Firebird 1.5) and the results are fine. After logging a TIBQuery object with the LogDataSet method, the record pointer is restored correctly and the returned data while iterating over the dataset is fine as well. Among others, I’ve tested with the following code snippet:

procedure TForm1.Button1Click(Sender: TObject);
begin
  Si.Enabled := True;
  IBQuery1.SQL.Text := 'SELECT * FROM Employee';
  IBQuery1.Open;
  try
    SiMain.LogDataSet('IBQuery1', IBQuery1);
    while not IBQuery1.Eof do
    begin
      SiMain.LogMessage(IBQuery1.Fields[1].AsString);
      IBQuery1.Next;
    end;
  finally
    IBQuery1.Close;
  end;
end;

The IBQuery1 object is set up to communicate via TCP with the database server and uses the Employee example database file which ships with the Interbase and Firebird installations.

To investigate this further, maybe you could post a code snippet or send me an example project via email which demonstrates the error.


#6

Hi,

I’v send you an email containing some snippets and an annotated SmartInspect logfile to help clarify the perceived problem.


#7

Hi,

Just to give those who read this thread some kind of closure ;). The behaviour was the result of setting the ‘Unidirectional’ property of the dataset to ‘True’.

This behaviour had nothing to do with the SmartInspect code.