Subject | RE: [firebird-support] Re: Triggers suitability |
---|---|
Author | Alan McDonald |
Post date | 2005-10-07T02:48:42Z |
> Just add an field say called 'version' BigInt to your DB Record and add ahuh? if 10 other records have been versioned in the meantime, the generator
> trigger for insert and update, which updates this field via a
> Generator. Now
> when you read the record, before you post, check if the value of
> 'version'
> is still the same, if not, someone else updated the record in the
> meantime.
>
> Create Generator Gen_Version
>
> In trigger before insert and update
> New.Version = Gen_ID(Gen_Version,1);
>
> If you use a different Generator for each Table of interest, the
> check for
> the 'version' value merely has
> to be a Gen_ID(Gen_Version,0) call
>
value will have advanced with no reference to the record in question. You
have to test your current record verion with the one in plave immediately
prior to posting.
Alan