Subject Problem with Transactions
Author Roberto Freitas
I have these objects on my program:
- IB_CursorCOR02 (TIB_Cursor)
- IB_Tr2 (TIB_Transaction)
At run time, I set:
CursorCOR02.IB_Transaction := IB_Tr2;
At this time, watching IB_Tr2's properties, I see:
InTransaction = False
Started = False
TransactionIsActive = False
Then, I set:
with IB_CursorCOR02 do begin
SQL.Clear;
SQL.Text := 'SELECT * FROM .... ';
end;
Then, I do:
IB_Tr2.StartTransaction;
At this time, watching IB_Tr2's properties, I see:
InTransaction = True
Started = False
TransactionIsActive = False
Then, I do;
CursorCOR02.Open; (or CursorCOR02.Prepare then CursorCOR02.Open)
At this time, watching IB_Tr2's properties, I see:
InTransaction = False
Started = True
TransactionIsActive = False
I am surprised, because I would expect InTransaction continue to be
True, because I have started an explicit transaction but I haven't
yet ended it.
What is wrong?