Why doesn't work a simple rollback to me (Zeos+D7+MySQL) ?

In this forum we will discuss things relating the ZEOSLib 6.6.x stable versions

Moderators: gto, EgonHugeist

Carcatrepa
Fresh Boarder
Fresh Boarder
Posts: 1
Joined: 27.01.2013, 17:49

Why doesn't work a simple rollback to me (Zeos+D7+MySQL) ?

Postby Carcatrepa » 27.01.2013, 18:06

Hi all, I'm new to ZeosLib.

I have Delphi 7, zeoslib 6.6.6 (also tried 7.0.3) and libmysql.dll
5.5.29 working over InnoDB database.

I have a conBD1 (TZConnection) with autocommit=true and a zqry1
(TZQuery) with "INSET INTO table (id) VALUES (:id)". I do:

...
conBD1.StartTransaction;

zqry1.ParamByName('id').AsInteger := 1;
zqry1.ExecSQL;
zqry1.ParamByName('id').AsInteger := 2;
zqry1.ExecSQL;
conBD1.Commit;

conBD1.StartTransaction;

zqry1.ParamByName('id').AsInteger := 3;
zqry1.ExecSQL;
zqry1.ParamByName('id').AsInteger := 4;
zqry1.ExecSQL;
conBD1.Rollback;
...

The table has finally 4 rows when i expect 2 because the last rollback.
What am I doing wrong ?

Regards

User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Postby mdaems » 30.01.2013, 21:48

Did you try attaching a ZSQLMonitor to your project to see the exact SQL that's executed? That could maybe reveal what's happening behind the scene.
Image


Return to “6.6 - stable”

Who is online

Users browsing this forum: No registered users and 1 guest