Subject Transaction and Datasets
Author sugi
Dear All,

Environment : Firebird 1.5, Delphi 6, IBO 4.2 (TDataset components)

It's a very normal situation to have more than one dataset connected to
a TIBOTransaction. Recently i came across a situation (a bug...:) where
a TIBOQuery.Open() is called before the form had a chance to call
TIBOTransaction.StartTransaction(), thus screwing up the transaction
handling logic in my application.

To prevent this in the future, i'm thinking about opening ALL TIBOQuery
connected to a particular TIBOTransactions at the same time (which after
i manually call StartTransaction()).

The question is : how can i do this with IBO ?
Please keep in mind that the TIBOQuery do not necessarily reside in the
same form/data module as the TIBOTransaction.

The property that looks promising was TIBOTransaction.Datasets[] and
TIBOTransaction.DatasetCount, but the code below produced an access
violation error in fbclient.dll. (Actually I didn't really expect it to
work, since the elements of the property were TIB_Datasets instead of
the TIBOxxxx components :D ).
...
assert(trans.inTransaction = false);
trans.startTransaction();
for i:=0 to trans.datasetcount-1 do begin
trans.datasets[i].open;
end;
...

Thank you very much in advance.
Regards,
sugiharto lim.

PS: I also came across what I think is a bug in TIBOQuery regarding
'select first n' queries. A simple statement like 'select first 5 from
table' will cause a 'token unknown error, line 3 char 6'. Is this a
known problem, or it's just me ? How do i report this to jwharton?