Subject | Re: [firebird-support] Re: Help with a trigger/procedure |
---|---|
Author | Fabio Gomes |
Post date | 2006-09-11T14:05:12Z |
If i understood correctly what i have to do, i m not updating anything, i ll
sum INSERT a new row with the sum and after that delete the rows used in the
sum. Am i going to have any problems?
sum INSERT a new row with the sum and after that delete the rows used in the
sum. Am i going to have any problems?
On 9/11/06, Alan McDonald <alan@...> wrote:
>
> > Just do the sum, delete, insert single row in a single transaction.
> > MGA will take care of the rest for you. If you follow the procedure,
> > it is impossible to get inaccurate data.
> >
> > Transactions starting prior to your sum procedure transaction
> > committing will see the old values of the table (and so get the right
> > result). Transactions starting after your sum procedure commits will
> > not see the deleted records but will see the single record (+ anything
> > since the sum transaction started).
> >
> > Adam
>
> But a transaction started by another user before the sum transaction is
> started and seemingly intent on updating a record to be summed but not
> committed until after the summing and deleting is committed will ... ahhh
> hopefully you're getting my drift... will either cause an exception on
> update or block the delete or just not update since the record doesn't
> exist
> anymore.
> 'UPDATE TABLE SET FIELD=0 WHERE id=1' - If record with ID 1 no longer
> exists, this update will silently go away with no exception.
> I'm not sure I like this recipe.
> If no updates are being contemplated on these records (ie. they're
> absolutely static in the design) then maybe,... but if they are being
> updated??
>
> Alan
>
>
>
[Non-text portions of this message have been removed]