Next: , Up: Database Methods   [Contents][Index]


4.3.1 blonde_base_detail

extern int blonde_base_detail(void *);

The function does a partial validation of the last recorded transaction for the $1 database.

The function returns 0 for seemingly valid last transactions, non zero otherwise.

The function is experimental. It may err both ways. Its result should be considered carefully, and possibly double checked.

If the last transaction had been deemed invalid, one possibility of restoring the database to an intended previous state is to drop the transaction. Transactions may be dumped (for an instance) by removing the last byte in the page map file for a closed database.

Dumping transactions may work because a number of past database states are preserved. This number is rather small (a few dozens at the time of writing this), and all preserved states come from the last database session.

Dumping transactions past the number of preserved database states can only reveal an unintended database state. Said number cannot be retrieved from the database. Dumping transactions is intended as a last resort method of recovering the database, as it destroys data. A prior backup should be considered.

nonblonde aims to have the database on disk in an intended state at all times and there’d ordinarily be no need for a validation or recovery procedure. The last transaction validation function is included for the sake of completeness, not because of a perceived real and frequent need.

Known conditions that brought about unintended database states include (and were limited to) power failures. Other possible (yet not observed) conditions include operating system crashes.

See Data Integrity.

See Database Structure.


Next: blonde_dump_detail, Up: Database Methods   [Contents][Index]