Different Behaviour outside the debugger

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
ben604
Posts: 7
Joined: Mon 18 Sep 2006 15:11

Different Behaviour outside the debugger

Post by ben604 » Mon 18 Sep 2006 15:22

I have come accross a very alarming situation. We bought these components to replace the standard TQuery TDatabase BDE combo within our multi tier servers.

So our servers accesses the DB then sends it accross to the client using COM inside a compressed stream stored in Variant Arrays.

Our lookup table is the first thing that is loaded by the server and is also the 1st thing requested by the client. When no delphi is running the amount of lookup Data received by the client is some random amount way less than the actual records. If either the client or the Server runs inside the debugger then the data returned is perfect.

I added debug code inside the server and the client that called RecordCount after the load. If i do this then it works perfectly as well. The query used is created using default settings as no properties are set except for the Connection.

The other strange thing is that if i manually start the server, then this does not happen either, but if windows starts the server when the first request come through then the error occurs. The fact that it works when i call RecordCount indicates to me that it might be some cacheing issue.

ben604
Posts: 7
Joined: Mon 18 Sep 2006 15:11

Post by ben604 » Mon 18 Sep 2006 16:09

Ok i've found the cause of the problem. It has nothing to do with the debugger or recordcount, well not directly anyway.

It is a threading issue. Becuase the debugger slows down the execution, it did not present itself then, same for the logging code or if you start the server manually.

For some reason the client belives the server is done loading when it is far from done, don't know if this is in anyway connected to the SDAC architecure, but will investigate further.

ben604
Posts: 7
Joined: Mon 18 Sep 2006 15:11

Post by ben604 » Mon 18 Sep 2006 22:21

The problem was not SDAC related, it merely presented itself because of its superior speed over the BDE.

Old threading bug that has been in our code for a while. Thanks to SDAC for pointing it out.

Post Reply