What triggers a TDaMemDataTable to Load Schema?

Hi,

I’m investigating why 2nd and subsequent opening of large queries is taking way longer than the 1st opening (E.g 1st opening = 7s, 2nd = 25s) and I’m wondering if it’s trying to load the schema (which is always been really slow).

I am building the fields programmatically before calling open and I have the RemoteDataAdapter.CacheSchema = True. I wouldn’t expect the schema to be re-loaded, but I’d like to be sure, so…

…what triggers a TDAMemDataTable to Load a Schema during an open call ?

Thanks

Hi,

can you create a simple testcase that reproduces this behavior, pls?

Schema is loaded when table.Fields.Count = 0.

you can uncomment {.$DEFINE BIN2DEBUG_time} definition in uDABin2DataStreamer.pas
it will generate some debug information via OutputDebugString so you can see what is wrong.

Hi

I’ll try, but of course this is in the middle of a much larger enterprise app. Might take a while.

Thanks - that’s not the problem then because I am creating the schema in the TDAMemDataTable before opening.

Tried that, got a few compile time errors:

" [dcc32 Fatal Error] uDABin2DataStreamer.pas(114): F2613 Unit ‘Winapi’ not found.

Fixed that, then got a few of these:

[dcc32 Error] uDABin2DataStreamer.pas(332): E2010 Incompatible types: ‘PWideChar’ and ‘PAnsiChar’
[dcc32 Warning] uDABin2DataStreamer.pas(1300): W1044 Suspicious typecast of string to PAnsiChar

(At which point I stopped trying to fix)

Thanks :smiley:

Looks like, it was written originally with non-unicode version of Delphi so just replace PAnsiChar with PChar.

Hi Evgeny,

I would appear that the problem was with the UI in the form - I wasn’t properly disconnecting the Grid from the TDAMemDataTable before clearing the grid columns.

I’m now getting consistently ~2s loading time.

Thanks

1 Like

cool