The steps for transaction
Posted: 09.04.2008, 09:51
I set zcon (TZConnection).autocommit=true. I try with 3 way to use transaction (database : MySQL 5.1, IDE : MSEgui, Lib Version : Last test trunk)
1. Record can append normally.
zcon.starttransaction;
zcon.executedirect('insert into salestrans (transid) values (''coba4'')');
zcon.commit;
2. Record can append normally.
zcon.autocommit:=false;
zcon.executedirect('insert into salestrans (transid) values (''coba4'')');
zcon.autocommit:=true;
3. Record can't append.
zcon.autocommit:=false;
zcon.executedirect('insert into salestrans (transid) values (''coba4'')');
zcon.commit;
4. Record can't rollback.
zcon.starttransaction;
zcon.executedirect('insert into salestrans (transid) values (''coba4'')');
zcon.rollback;
5. Record can rollback.
zcon.autocommit:=false;
zcon.executedirect('insert into salestrans (transid) values (''coba4'')');
zcon.rollback;
Than I am confusing about these steps, is it bug of transaction?
wahono
1. Record can append normally.
zcon.starttransaction;
zcon.executedirect('insert into salestrans (transid) values (''coba4'')');
zcon.commit;
2. Record can append normally.
zcon.autocommit:=false;
zcon.executedirect('insert into salestrans (transid) values (''coba4'')');
zcon.autocommit:=true;
3. Record can't append.
zcon.autocommit:=false;
zcon.executedirect('insert into salestrans (transid) values (''coba4'')');
zcon.commit;
4. Record can't rollback.
zcon.starttransaction;
zcon.executedirect('insert into salestrans (transid) values (''coba4'')');
zcon.rollback;
5. Record can rollback.
zcon.autocommit:=false;
zcon.executedirect('insert into salestrans (transid) values (''coba4'')');
zcon.rollback;
Than I am confusing about these steps, is it bug of transaction?
wahono