So might there be a bug somewhere?
For a while my code worked fine, HeapTrc reported no unfreed memory blocks.
But now it again crashes, complaining "EdatabaseError: Operation cannot be performed on an active transaction".
I have written my own procedure, which closes the transactions. And it works fine. It only raises exception after that, returning the debugger inside destructor TControl.Destroy in control.inc
This is beyond my understading. First it manages to close the transaction with no problem, and in the next instant it complains that it can't destroy an active transaction ???
help, please, anyone
EDIT,
for testing, I tried this;
procedure TMyForm2.Closedatabases
begin
SQLQuery1.Free;
SQLQuery2.Free;
SQLQuery3.Free;
SQLTransaction1.Rollback;
SQLTransaction1.Active:=false;
SQLTransaction1.Free;
ODBCMyConn.Free;
end;
and - it crashes at "SQLTransaction1.Free", complaining that operation cannot be performed on active transaction.
Those component's aren't created manually in my code, I just dragged and dropped them on MyForm2.
---
EDIT2;
I even tried
SQLTransaction1.Active:=false;
if SQLTransaction1.Active = true
then showmessage('SQLTransaction1.Active=true')
else showmessage('SQLTransaction1.Active=false');
and it shows the message with true. Uh oh.
I also tried with SQLTransaction1.EndTransaction, but with same result - in the next instant it still seem that SQLTransaction1.Active = true.
I find all of this hard to understand. I know this kind of issues might be caused by memory leaks elsewhere in the code. But a moment ago it was all working fine and HeapTrc reporting no unfreed memory blocks. Any ideas? I have none.