Subject | Re: [IBO] correct closing of MDI-children ? |
---|---|
Author | TeamIBO |
Post date | 2002-01-10T23:17:53Z |
> I have a MDI-Application with a connection and transaction componentIf you are happy with AutoCommit then the single transaction on the
> on the MDI-parent form (tiCommited,Autocommit) on many MDI-child
> forms I use TIB_Query objects with the connection from the mainform.
> In the OnCreate-method I open the query. What happens when the user
> closes the form? Causes this a Commit (or Commitretaining) ? Should
> I write a OnClose event handler ?
>
> e.g TIB_Query.close or is it a good idea to do some transaction
> handling in such a handler perhaps start a new Trancaction
main form should be adequate and there is nothing much to do when you
close the form other than ensure outstanding dataset changes are
posted (check the NeedToPost property of the datasets).
In my MDI apps I usually have a transaction (without AutoCommit) on
each child form. In the child form CloseQuery event I ask the user to
save/discard/cancel and then commit/rollback/abort-the-close
accordingly. I have save/cancel buttons on the toolbar which
commit/rollback the transaction on the active form on request.
(An over-simplification but you get the idea?)
Is this what you were looking for?
--
Geoff Worboys - TeamIBO
Telesis Computing