GetCatalogNames bug
Posted: 08.06.2009, 08:36
Hello,
I'm doing an app that needs to delete, duplicate and move a few databases around. It is working as it should but unnexpectedly I started to see a few weird behaviour in my program. I traced them down to the GetCatalogNames function.
This function always returns the same thing after you've done it once even if you use the .Reconnect procedure. It only gets the new data after a .Disconnect followed by a .Connect (was't this what reconnect was supposed to do?).
So basically, in my opinion, this functions behaviour is wrong to everyone using a persistent connection to a database. Suggested solution as follows:
Function GetCatalogs from ZDbcMetadata.pas file, line 2220.
Just commenting out the cached results should do the trick. Or another GetUnchachedCatalogNames could also resolve the issue. Or perhaps a GetCachedCatalogNames would be best since this is not the expected behaviour.
Thank you,
I'm doing an app that needs to delete, duplicate and move a few databases around. It is working as it should but unnexpectedly I started to see a few weird behaviour in my program. I traced them down to the GetCatalogNames function.
This function always returns the same thing after you've done it once even if you use the .Reconnect procedure. It only gets the new data after a .Disconnect followed by a .Connect (was't this what reconnect was supposed to do?).
So basically, in my opinion, this functions behaviour is wrong to everyone using a persistent connection to a database. Suggested solution as follows:
Function GetCatalogs from ZDbcMetadata.pas file, line 2220.
Code: Select all
function TZAbstractDatabaseMetadata.GetCatalogs%u3a IZResultSet;
//var
// Key%u3a string;
begin
// Key %u3a= GetCatalogsCacheKey;
// Result %u3a= GetResultSetFromCache%u28Key%u29;
// if Result = nil then
// begin
Result %u3a= UncachedGetCatalogs;
// AddResultSetToCache%u28Key, Result%u29;
// end;
end;
Thank you,