Rollback issue when using two queries with cached updates
Posted: Wed 27 Jul 2016 14:55
hi,
I use Unidac 4.6.11 in Delphi XE2 , I have two Queries which are in cached updates mode , also both of them have same update transaction (UniTransaction1), this is the code that I use in the save button :
UniTransaction1.StartTransaction;
try
Query2.applyupdates;
Query1.applyupdates;
UniTransaction1.Commit;
except
UniTransaction1.RollBack;
end;
if one of the queries fail , both of them must be rollbacked , but the problem is that even if one of them fails the other saves normally.
I need to know where is the problem in my code. and if you have another approach please advice me.
thanks in advance.
I use Unidac 4.6.11 in Delphi XE2 , I have two Queries which are in cached updates mode , also both of them have same update transaction (UniTransaction1), this is the code that I use in the save button :
UniTransaction1.StartTransaction;
try
Query2.applyupdates;
Query1.applyupdates;
UniTransaction1.Commit;
except
UniTransaction1.RollBack;
end;
if one of the queries fail , both of them must be rollbacked , but the problem is that even if one of them fails the other saves normally.
I need to know where is the problem in my code. and if you have another approach please advice me.
thanks in advance.