Hi list,
I'm working on improving bufdataset testing in the dbtestframework, documenting the framework a bit more. (Attached FYI my current version of the readme; comments welcome as always).
I found this in sqldbtoolsunit.pas:
destructor TSQLDBConnector.Destroy;
...
if assigned(FTransaction) then
begin
try
if Ftransaction.Active then Ftransaction.Rollback;
Ftransaction.StartTransaction;
Fconnection.ExecuteDirect('DROP TABLE FPDEV2');
Ftransaction.Commit;
Except
if Ftransaction.Active then Ftransaction.Rollback
end; // try
end;... however, I don't see any corresponding CREATE TABLE FPDEV2 in the rest of the code or any mention of it?
In the rest of the code, it seems the tables FPDEV and FPDEV_FIELDS are correctly
CREATEd in CreateNDatasets/CreateFieldDataset
and
DROPped in DropNDatasets/DropFieldDataset
That FPDEV2 code seems like some last-ditch recovery effort to delete
the generated tables... couldn't that be replaced by:
destructor TSQLDBConnector.Destroy;
...
if assigned(FTransaction) then
begin
try
if Ftransaction.Active then Ftransaction.Rollback;
Ftransaction.StartTransaction;
Fconnection.ExecuteDirect('DROP TABLE FPDEV');
Ftransaction.Commit;
Ftransaction.StartTransaction;
Fconnection.ExecuteDirect('DROP TABLE FPDEV_FIELDS');
Ftransaction.Commit;
Except
if Ftransaction.Active then Ftransaction.Rollback
end; // try
end;Thanks,
Reinier
