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
The steps for transaction
Moderators: gto, cipto_kh, EgonHugeist
- mdaems
- Zeos Project Manager
- Posts: 2766
- Joined: 20.09.2005, 15:28
- Location: Brussels, Belgium
- Contact:
Hi,
Did first investigation. One of the involved factors seems to be the Transaction Level setting tiNone. When that setting is used Commit and Rollback are not sent to the server. (Trick to do this kind of tests : add a TZSQLMonitor to your project.)
This will involve some more study, I'm afraid.
Mark
Did first investigation. One of the involved factors seems to be the Transaction Level setting tiNone. When that setting is used Commit and Rollback are not sent to the server. (Trick to do this kind of tests : add a TZSQLMonitor to your project.)
This will involve some more study, I'm afraid.
Mark
I think query that is executed from anywhere, from tzquery or from tzstatement or from tzconnection.executedirect should can process as transaction. Because transaction is from database engine.gto wrote:IMHO, TZConnection.ExecuteDirect seems like a function, which by the way, works very well, that would not respect the transactions.
But if it came to support , no problem
wahono
You are right, IMHO needs message if we use starttransaction, commit and rollback and transaction level is none or database server isn't support transaction.mdaems wrote:Hi,
Did first investigation. One of the involved factors seems to be the Transaction Level setting tiNone. When that setting is used Commit and Rollback are not sent to the server. (Trick to do this kind of tests : add a TZSQLMonitor to your project.)
This will involve some more study, I'm afraid.
Mark
Thanks,
wahono