Subject Re: [firebird-support] Re: lock the table "partially"
Author Ann Harrison
On Mon, Feb 20, 2012 at 5:15 AM, nathanelrick <nathanelrick@...> wrote:

>
> Now time to time i need to reset the calculation for one particular product, so i simply launch a query that count all item and set the item_count of the product ... but of course during this calculation, no one must be able to add (or delete) a new item to the product because if yes my calculation will be false ... for this i must forbid to add any row in the temp table with item related to the product i update
>
Let me expand slightly on Sven's good answer.

Firebird's concurrency mode runs as if other transactions were unable
to change the database while it is running. It's like a private
snapshot of the database, with the exception that Firebird detects
conflicting updates when they happen. So you can aggregate your data,
delete the temporary entries, and simply ignore any other changes that
happen concurrently. They will appear to have happened after your
transaction completed.

Good luck,

Ann