|Subject||Re: master updation using trigger|
>>Then your system continues with inserting 1 and -1 againmode?
> Is it really needed if all the applications use snapshot transaction
Yes, Alan's solution is required even in snapshot mode to avoid lock
conflicts on the product table if two of more transactions attempt to
simultaneously insert/update/delete a record from sale_det for the
same company/product combination. If this occurs, you have two
transactions trying to update the *same* record within product, which
if the second attempts it from a transaction started before the first
commits would cause a lock conflict.
The only way to solve this problem other than the suggestion by Alan
is to serialise the changes, which is hardly a solution in most cases.