Subject Transaction confusion
Author John Peterson
Hi All,
I have a fairly simple service application that inserts records into a table. The app uses TIB_CONNECTION and TIB_DSQL components in a Data Module to perform the insertion.

Code snippet:

if not DM1.SQL.Prepared then DM1.SQL.Prepare;
with DM1.SQL.Params do begin
Columns[0].AsInteger := StrToInt(copy(Su9.Line[3],29,6)); //SIDO
......
Columns[84].AsString := copy(Su9.Line[5],71,1); // Tyre Decal
end;
DM1.SQL.Execute;

SQL:

INSERT INTO TRM
(
"SIDO",
.......
"TYREDECAL"
)
values
(
?SIDO,
.......
?TyreDecal
)


All runs well for a week or so (a few thousand insertions), then I get a Interbase error:

ISC Error: 335544569 (-901)
Invalid Transaction Handle (expecting explicit transaction start)

My question is: What is the correct way to perform this operation in a robust way. There are so many choices, and based on the infrequency of the error is next to impossible to fix by 'trying' things.
Should I set up a Transaction Component as well?
I also suspect the app is leaking memory....but cannot confirm this.

TIA
John


[Non-text portions of this message have been removed]