Subject | Re: [firebird-support] Re: triggers |
---|---|
Author | Ann W. Harrison |
Post date | 2005-08-01T18:12:56Z |
Adam wrote:
A danger in your solution is that a customer's balance could become
negative without any one transaction noticing it. If that's important,
then blocking updates on the balance until a transaction that modified
it is committed is the best answer.
Regards,
Ann
>...
> If a customer can have two different transactions running at the same
> time, the second transaction will be effectively locked out of
> updating the customer balance while the first one completes because
> there will be a lock on the customers balance record.
>
> If it is an issue, then create your customer balance table like this.
A danger in your solution is that a customer's balance could become
negative without any one transaction noticing it. If that's important,
then blocking updates on the balance until a transaction that modified
it is committed is the best answer.
Regards,
Ann