Search code examples
delphidelphi-xe7accuracerdb

accuracer : transaction not working


Database and the components,query & table are from Accuracer.

I am using a simple delete query :

procedure TMain_Form.Button1Click(Sender: TObject);
begin
DATA_MODULE.QUERY.Close;
DATA_MODULE.QUERY.SQL.Clear;
//DATA_MODULE.QUERY.SQL.Add('START TRANSACTION;');
DATA_MODULE.QUERY.SQL.Add('delete from TABLE where DONE = TRUE');

try
//DATA_MODULE.QUERY.SQL.Add('COMMIT;');
DATA_MODULE.QUERY.ExecSQL;
DATA_MODULE.TABLE.Refresh;
except
//DATA_MODULE.QUERY.SQL.Text := 'ROLLBACK';
//DATA_MODULE.QUERY.ExecSQL;
DATA_MODULE.TABLE.Cancel;
end;
end;

If I leave the query as it is above, it works. As soon as I uncomment the lines, it does not. It just deletes records from my grid but the data in the database is intact.

Am I messing up something here ?


Solution

  • It seems, according to the documentation found here (Multi-User and Multi-Thread, Locking Mechanism and Transactions) : http://www.aidaim.com/products/acr/guide_bde_alternative_client-server_single-file_embedded_bde_replacement_database_delphi_c++builder_kylix/index.php

    that "- Emptying, Restructuring, Deleting and Renaming tables involved in the transaction " are operations that are incompatible with transactions.

    If I am wrong, correct me.