Transaction should be closed when TIBCQuery (DataSet) is closed, and Transaction was started by that component. Same as IBX TIBTransaction.
When I use TClientDataSet + TDataSetProvider + TIBCQuery and I open the ClientDataSet and also the TIBQuery is opend and closed, but the transaction is automaticlally started but not closed. In a n-tier solution (e.g. DataSnap) I open the ClientDataSet in the the client but have no access to the underlying Query and Transaction which is on the server side.
The TIBTransaction has that feature implemented and is very handy to use.
-
Markus J. commented
Add the folowing line to the overriden TDataSet.InternalClose procedure:
if Assigned(Transaction) then
Transaction.CheckAutoStop; //<- New function: If TDataSet.Open did start the transaction then perform AutoStop action. -
Markus J. commented
It seems you just need to override the virtual functions
- TDataSet.PSInTransaction,
- TDataSet.PSStartTransaction and
- TDataSet.PSEndTransaction.Then the provider can handle it.