Subject Re: [firebird-support] How would Firebird handle this.
Author Ann Harrison
Iwan Cahyadi Sugeng <iwan.c.sugeng@...> wrote:

...the real problem lies on the
> data integrity problem,
>
> So opening balance is 10, all user only knows that the balance is 10, so
> all user transaction is valid, but because you are saving the stock in a
> field, then you would get unknown value for each user transaction and will
> cause inconsistency.
>
> Unless you use autocommit, that situation can't occur. If you read 10 and
some other transaction reduces it by six, your transaction will get an
update
conflict when it tries to change the balance. If you can't see the most
recent
state of a record, you can't change it.

The real problem with keeping a single number, like an inventory, that gets
updated a lot by different concurrent users is that they will see lots of
update
conflict errors. The only way to update a record one which you've had an
update conflict is to rollback and restart your transaction.

Good luck,

Ann


[Non-text portions of this message have been removed]