Patch for PSQL Accessviolation
Posted: 06.04.2014, 12:31
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
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