Subject Re: [firebird-support] Re: What happens if the power fails
Author Ann Harrison
Martin wrote

> ok - but if it reaches the commit stage, and the unlikely scenario
>
>happens, that the power fails during the commitments.
>Ex. 5 tuples to be updated, the first 2 gets updated, then the power
>fails and the rest never gets updated.
>Will the first 2 then be rolled-back on start-up, or will they have
>the updated data?
>
When you send a commit message, all pages changed by your transaction
are written to disk. Some pages may already have been written because
you and another transaction both changed them and the other transaction
committed. Or because the cache was full and something had to go. Or
because your transaction updated pages that would cause a loop in the
dependency graph. Once the pages are on disk, the event that actually
commits the transaction occurs. The state of the transaction on the
transaction inventory page changes from active to committed. A single
page write completes the commit. Until that page is written, your data
will be ignored or removed if your transaction ends without changing its
state on the transaction page.

Regards


Ann