understand transaction
Posted: Tue 01 Jul 2008 15:36
Hello,
There is something that i don't really understand in transactions.
Here is my code :
frmMain.IBCQry.AutoCommit:=FALSE;
frmMain.IBCQry.Transaction:=frmMain.IBCTrnsctn;
if frmMain.IBCTrnsctn.Active=true then
showMessage('active1');
frmMain.IBCQry.sql.Text:='INSERT INTO ENREGISTREMENTS ' +
'(NUM, REF_DAT, NOM_SITE, DATE_ENREG, HEURE, VE, VS, K, PHASE, TYP) ' +
'VALUES (:NUM, :REF_DAT, :NOM_SITE, :DATE_ENREG, :HEURE, :VE, :VS, :K, :PHASE, :TYP)';
frmMain.IBCQry.Prepare;
if frmMain.IBCTrnsctn.Active=true then
showMessage('active2');
frmMain.IBCTrnsctn.StartTransaction;
I don't understant why the showMessage('active2') appears?
Why is the transaction active whereas the starttransaction is after?
How can i solve the problem because when i call starttransaction i have an error message
Thank you for help
Regards
There is something that i don't really understand in transactions.
Here is my code :
frmMain.IBCQry.AutoCommit:=FALSE;
frmMain.IBCQry.Transaction:=frmMain.IBCTrnsctn;
if frmMain.IBCTrnsctn.Active=true then
showMessage('active1');
frmMain.IBCQry.sql.Text:='INSERT INTO ENREGISTREMENTS ' +
'(NUM, REF_DAT, NOM_SITE, DATE_ENREG, HEURE, VE, VS, K, PHASE, TYP) ' +
'VALUES (:NUM, :REF_DAT, :NOM_SITE, :DATE_ENREG, :HEURE, :VE, :VS, :K, :PHASE, :TYP)';
frmMain.IBCQry.Prepare;
if frmMain.IBCTrnsctn.Active=true then
showMessage('active2');
frmMain.IBCTrnsctn.StartTransaction;
I don't understant why the showMessage('active2') appears?
Why is the transaction active whereas the starttransaction is after?
How can i solve the problem because when i call starttransaction i have an error message
Thank you for help
Regards