Bug in TZSQLMetadata resultset caching

The forum for ZeosLib 7.2 Report problems. Ask for help, post proposals for the new version and Zeoslib 7.2 features here. This is a forum that will be edited once the 7.2.x version goes into RC/stable!!

My personal intention for 7.2 is to speed up the internals as optimal a possible for all IDE's. Hope you can help?! Have fun with testing 7.2
Post Reply
ga301
Fresh Boarder
Fresh Boarder
Posts: 6
Joined: 07.04.2018, 20:47

Bug in TZSQLMetadata resultset caching

Post by ga301 »

Hi,

I think I may have tracked down the cause for the problem I reported in http://zeoslib.sourceforge.net/viewtopi ... 40&t=73973:
It seems that the metadata TZVirtualResultset which has been cached for some combination of tablename and property will be closed, when TZSQLMetadata.Close is called. So, if I want to use TZSQLMetadata to get some info for a table and at a later time I want to get the same info again, this will not work, because the cached resultset has been cleared.
There is actually a guard (property DoNotCloseResultset) which could be used to prevent this in the special case where a resultset is cached.

So I tried the following and it seems to work:

1. In ZAbstractRODataset.pas modify the property declaration of DoNotCloseResultset (make it writable):

Code: Select all

property DoNotCloseResultset: Boolean read FDoNotCloseResultset write FDoNotCloseResultset;
2. In ZSqlMetadata.pas, override the InternalClose method:

Code: Select all

TZSQLMetadata = class(TZAbstractRODataset)
protected
...
    procedure InternalClose; override;
...

Code: Select all

procedure TZSQLMetadata.InternalClose;
begin
  DoNotCloseResultSet := true;
  inherited;
end;
I have not yet checked if this introduces any memory leaks or affects other components, but I do not think that it should.

Can somebody please approve and include this fix (or anything else that targets this problem)?
Thank you very much.

Best regards
Gunnar
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1918
Joined: 17.01.2011, 14:17

Re: Bug in TZSQLMetadata resultset caching

Post by marsupilami »

Hello Gunnar,

Egonhugeist told me that the problem should be fixed in the Zeos 7.2 branch by now as well. Could you please try that?
With best regards,

Jan
volkerp
Fresh Boarder
Fresh Boarder
Posts: 2
Joined: 26.06.2018, 06:41

Re: Bug in TZSQLMetadata resultset caching

Post by volkerp »

Hello,

in 7.2.4 stable this problem persists :(
you can simple test it with the ZControlsExample example.
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1918
Joined: 17.01.2011, 14:17

Re: Bug in TZSQLMetadata resultset caching

Post by marsupilami »

Hello Volker,

we didn't create a new release of Zeos 7.4 yet. If you need this bug fixed, you might want to download a snapshot from our SVN:
https://sourceforge.net/p/zeoslib/code- ... 2-patches/

We currently plan to release Zeos 7.2.6 in the upcoming weeks. Then this bug will be fixed in a release version.

Best regards,

Jan
Post Reply