Re: NewEra database update hassles
Posted in 1995
Neil,
I forgot to tell you that you can use either method. You can turn on and
off the auto commit. I am not sure how this is done, since I have not yet
played around with 1.1. Sorry if I confused you. Informix added the
auto commit so that it would act like their 4gl.
Matt
On Thu, 6 Apr 1995, Neil S. Briscoe wrote:
>
> Hmm, will it. What about the very common situation of an update of,
> say, a Sales Ledger account.
>
> Some action means you have to write a transaction to the sl_items table
> and also update the Balance field of the sl_account table.
>
> Currently, you would do something like the following in pseudo code :-
>
> begin work
>
> update sl_account
> set balance = balance + amount
>
> if error
> rollback work
> end if
>
> insert into sl_items
> values (acno, item, [various other fields] amount)>
> if error
> rollback work
> else
> commit work
> end if
>
>
> Now, you have to have both these SQL actions succeed to commit
> the transaction or else you have to roll it back, so neither happens.
>
> If, as you say, NewEra 1.1 treats each SQL statement as a transaction
> in its own right, surely this will mean you loose database integrity.
>
> Regards
> Neil
>
> --
>
> Neil S. Briscoe | The Three Stages of Life:
> Aldershot, Hants, England | First, you believe in Father Christmas
> neil@salmon.demon.co.uk | Then you don't believe in Father Christmas
> nbriscoe@cix.compulink.co.uk | And then, you are Father Christmas
>
>