I have received an access violation because a column was inserted into a table. See topic http://zeoslib.sourceforge.net/viewtopi ... 38&t=11384
The reason was that an active connection has not registered that the metadata has changed, because all TableInfos are cached - for performance reasons.
I have attached a patch where I first check if the cached column number of the current column number corresponds. If not, the cache is updated. It will only read data used for comparison is therefore virtually no perfomance loss there. An error that persists is, if not the number of columns will change, but for example their name. However, this is imho negligible.
For me, the patch works fine now, whether it can be taken as 1:1 or whether this functionality would also be adapted for other databases, I do not know.
Greetings Michl
[edit] I forgot a "Refresh", changed patch attached
Patch for PSQL Accessviolation
Patch for PSQL Accessviolation
You do not have the required permissions to view the files attached to this post.
- EgonHugeist
- Zeos Project Manager
- Posts: 1936
- Joined: 31.03.2011, 22:38
Re: Patch for PSQL Accessviolation
Hi michl,
i'll check this out and give you a second reply...
i'll check this out and give you a second reply...
Best regards, Michael
You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/
You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/
- EgonHugeist
- Zeos Project Manager
- Posts: 1936
- Joined: 31.03.2011, 22:38
Re: Patch for PSQL Accessviolation
Me again, just did check your patch...
I did change some parts: intead of clearing the whole chache i simple refresh the data of the current entry. Hope you agree.
Patch done R3181 /testing-7.2 (SVN)
But thinking about it makes me .... What happens if just a columnname did change? IMO the field should become readonly because the compare between geneic PG-Data and Metadata fails, or am i wrong?
Cheers Michael
I did change some parts: intead of clearing the whole chache i simple refresh the data of the current entry. Hope you agree.
Patch done R3181 /testing-7.2 (SVN)
But thinking about it makes me .... What happens if just a columnname did change? IMO the field should become readonly because the compare between geneic PG-Data and Metadata fails, or am i wrong?
Cheers Michael
Best regards, Michael
You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/
You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/
Re: Patch for PSQL Accessviolation
I've updated my zeos and make some tests. In that tests and in my project it seems to work.
Thank you for your work! Now I have not to patch zeos, when I should reinstall my Lazarus, very nice!
Thank you for your work! Now I have not to patch zeos, when I should reinstall my Lazarus, very nice!