Hello All. Latest Lazarus Win32. freetds or OleDB, msql
With ZQuery.CachedUpdates := true;
My project crashes when ZQuery.ApplyUpdates with message … "0 recod(s) updated. Only one record should have been updated."
In my case i insert new record, then recalculate all records in dataset. After that ZQuery.ApplyUpdates ... and the message appear.
In unit ZDbcCachedResultSet.pas, procedure TZAbstractCachedResultSet.PrepareRowForUpdates;
i found that my new record with .UpdateType = utInserted becomes FUpdatedRow.UpdateType := utModified; // program row:531
Thank to all
I have truble with TZQuery.CachedUpdates := True in my project
-
- Platinum Boarder
- Posts: 1962
- Joined: 17.01.2011, 14:17
Re: I have truble with TZQuery.CachedUpdates := True in my project
Hello,
could you try to supply a little example that raises this error? Otherwise we have to guess what goes on and we might do the wrong guesses.
Best regards,
Jan
could you try to supply a little example that raises this error? Otherwise we have to guess what goes on and we might do the wrong guesses.
Best regards,
Jan
Re: I have truble with TZQuery.CachedUpdates := True in my project
What exactly recalculating all records mean? Can you do that AFTER the ApplyUpdates?
If you are moving the cursor from the inserted row, that will result an immature post. Once you modify the inserted record, it's possible that it will be considered as modified when you reach .ApplyUpdates.
An other thing you can try is NOT to use .CachedUpdates, only connection transactions. I had my fair share of trouble with .CachedUpdates and decided not to use this feature at all as it was giving only a minor performance increase compared to transactions / transactions & cachedupdates.
If you are moving the cursor from the inserted row, that will result an immature post. Once you modify the inserted record, it's possible that it will be considered as modified when you reach .ApplyUpdates.
An other thing you can try is NOT to use .CachedUpdates, only connection transactions. I had my fair share of trouble with .CachedUpdates and decided not to use this feature at all as it was giving only a minor performance increase compared to transactions / transactions & cachedupdates.
Delphi 12.2, Zeos 8 from latest GIT snapshot
Using:
- MySQL server 8.0.18; libmysql.dll 8.0.40 x64 5.7.19 x68, libmariadb.dll 3.3.11
- Oracle server 11.2.0, 12.1.0, 19.0.0; oci.dll 21.15
- MSSQL 2012, 2019; sybdb.dll FreeTDS_3102
- SQLite 3.47
Using:
- MySQL server 8.0.18; libmysql.dll 8.0.40 x64 5.7.19 x68, libmariadb.dll 3.3.11
- Oracle server 11.2.0, 12.1.0, 19.0.0; oci.dll 21.15
- MSSQL 2012, 2019; sybdb.dll FreeTDS_3102
- SQLite 3.47
Re: I have truble with TZQuery.CachedUpdates := True in my project
hi,
I think that all inserted records in cached state before ApplyUpdates must remain Inserted.
In my case:
1. the dataset is in cached state;
2. do insert of new record with default values;
3. do post
4. recalculate values (some fields) in dataset with first, edit, supply values, post, next.. to the end
5. AppluUpdate (in this point only update statement is trying to send to the server)
6. Error is raised
I think that all inserted records in cached state before ApplyUpdates must remain Inserted.
In my case:
1. the dataset is in cached state;
2. do insert of new record with default values;
3. do post
4. recalculate values (some fields) in dataset with first, edit, supply values, post, next.. to the end
5. AppluUpdate (in this point only update statement is trying to send to the server)
6. Error is raised
- EgonHugeist
- Zeos Project Manager
- Posts: 1936
- Joined: 31.03.2011, 22:38
Re: I have truble with TZQuery.CachedUpdates := True in my project
Hi ash71,
1.
please reply here: viewtopic.php?f=50&t=125819
we are waiting for an test to resolve the ticket: https://sourceforge.net/p/zeoslib/tickets/438/
2. Is this regression related to: https://sourceforge.net/p/zeoslib/tickets/446/ ??
could you provide a simple app which demonstrates the problem?
1.
please reply here: viewtopic.php?f=50&t=125819
we are waiting for an test to resolve the ticket: https://sourceforge.net/p/zeoslib/tickets/438/
2. Is this regression related to: https://sourceforge.net/p/zeoslib/tickets/446/ ??
could you provide a simple app which demonstrates the problem?
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: I have truble with TZQuery.CachedUpdates := True in my project
Double post,
please update. I added a a dbc test for that report see https://sourceforge.net/p/zeoslib/code-0/6957/. Yet i had no time to port the test to to the dataset level. However please test and report your findings.
please update. I added a a dbc test for that report see https://sourceforge.net/p/zeoslib/code-0/6957/. Yet i had no time to port the test to to the dataset level. However please test and report your findings.
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: I have truble with TZQuery.CachedUpdates := True in my project
Hi there,
Today i reinstalled zeoslib and find that in my cases with Cached Updates all things works perfectly. Thanks.
I found that in unit ZFunctionsStrings needs to add Math in unit section, related to compile error in row 282
d[i, j] := Min(
Min(d[i-1,j]+1, // deletion
d[i,j-1]+1), // insertion
d[i-1,j-1]+Cost); // substitution
Best regards,
ash
Today i reinstalled zeoslib and find that in my cases with Cached Updates all things works perfectly. Thanks.
I found that in unit ZFunctionsStrings needs to add Math in unit section, related to compile error in row 282
d[i, j] := Min(
Min(d[i-1,j]+1, // deletion
d[i,j-1]+1), // insertion
d[i-1,j-1]+Cost); // substitution
Best regards,
ash
- EgonHugeist
- Zeos Project Manager
- Posts: 1936
- Joined: 31.03.2011, 22:38
Re: I have truble with TZQuery.CachedUpdates := True in my project
Fixed as suggested (my FPC's didn't show that compilation error). Thanks.
However please take attantion to viewtopic.php?f=50&t=125819 or i'll close the ticket...
However please take attantion to viewtopic.php?f=50&t=125819 or i'll close the ticket...
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/