Subject | Re: Transaction open after a required field not populated , how to fix |
---|---|
Author | Eric Handbury |
Post date | 2002-10-28T22:31:11Z |
--- In IBObjects@y..., "wayne" <waynef@w...> wrote:
RollbackRetaining so that the datasets remain open, but the
Transaction is killed.
> I have a From wtih many datasets...data,
> They are all in insert mode, all fields are populated with correct
> except one REQUIRED field has no data.Open/Started for
>
> My Code below is not perfect since a transaction will be
> an undetermine period of time.Why can't you Rollback on the 1st exception? Or do a
>
>
> ************OnClick Event Code Below ******************
> try
> tableAcc.Post;
> tableEnq.Post;
> rbUpdate1.FlushCache;
> except on e: Exception do
> begin
> MessageDlg('Error ', mtWarning, [mbOK], 0);
> exit; // Get out of here and dont Commit yet //
> *****************we have a TRansaction Open *****************
> *** Start a Timer ***
> end;
>
> try
> trClient.Commit;
> Close; // Close the Form
> except on e: Exception do
> begin
> MessageDlg('Error Rolling back' , mtWarning, [mbOK], 0);
> trClient.Rollback;
> end;
> end;
RollbackRetaining so that the datasets remain open, but the
Transaction is killed.