TZAbstractDataset.CommitUpdates

The official tester's forum for ZeosLib 7.1. Ask for help, post proposals or solutions.
Post Reply
rautgigi
Fresh Boarder
Fresh Boarder
Posts: 16
Joined: 08.10.2006, 19:54

TZAbstractDataset.CommitUpdates

Post by rautgigi »

Hi,

I think there is an error inside TZAbstractDataset.CommitUpdates in ZAbstractDataSet.pas. There should be a call to CachedResultSet.PostUpdates instead of CachedResultSet.CancelUpdates. PostUpdates call PostRowUpdates(OldRowAccessor, NewRowAccessor), which will copy buffer from NewRowAccessor. If we call CancelUpdates the buffer is copied from InitialRow to CurrentRow.

To fix it, we should modify:

procedure TZAbstractDataset.CommitUpdates;
begin
CheckBrowseMode;

if CachedResultSet <> nil then
CachedResultSet.CancelUpdates;
end;

Into :
procedure TZAbstractDataset.CommitUpdates;
begin
CheckBrowseMode;

if CachedResultSet <> nil then
CachedResultSet.PostUpdates;
end;

All the best,
Bogdan
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Re: TZAbstractDataset.CommitUpdates

Post by EgonHugeist »

First i was thinking you are right, but:

http://docwiki.embarcadero.com/Librarie ... mitUpdates

Bogdan, something else:

Could you please recompile FreeTDS? With the bcp_functions(i'll implement the batch insartiation later) and it would be nice to get the three missing functions running:
function dbRetData(dbProc: PDBPROCESS; RetNum: DBINT): Pointer;
function dbRetLen(dbProc: PDBPROCESS; RetNum: DBINT): DBINT;
function dbRetType(dbProc: PDBPROCESS; RetNum: DBINT): DBINT;

We are still not able to execute stored-procedures with FreeTDS
Best practice for later "prepare refactoring" would be to have all of these http://technet.microsoft.com/en-us/libr ... 80%29.aspx function available.
Any ideas? Do you know why?
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/

Image
rautgigi
Fresh Boarder
Fresh Boarder
Posts: 16
Joined: 08.10.2006, 19:54

Re: TZAbstractDataset.CommitUpdates

Post by rautgigi »

Hi Michael,

Yes it's seems that PostUpdates is not the right direction, but also CancelUpdates is not ok, i think there should be DisposeCachedUpdates (in order to only free the cached rows). If you work in AutoCommit, than ApplyUpdates call PostUpdates which copy data and free cached rows. When you are not in AutoCommit only copy data from cache and doesn't free cached rows.

For FreeTDS i see that the functions are ok, i will try to export and recompile the library.

All the best,
Bogdan
miab3
Zeos Test Team
Zeos Test Team
Posts: 1310
Joined: 11.05.2012, 12:32
Location: Poland

Re: TZAbstractDataset.CommitUpdates

Post by miab3 »

@rautgigi,
rautgigi wrote: For FreeTDS i see that the functions are ok, i will try to export and recompile the library.
Could you try it with the newer version of the source?
Maybe this?
http://fossies.org/linux/privat/
http://fossies.org/linux/privat/freetds ... 12.tar.gz/

Michal
Post Reply