Journaling

This section describes functions that can be used for session journaling. This is required for session-oriented applications to handle session rejection or crash recovery. In these cases the application has to be able to restore the state of the database back to where it was before the session.

Journaling script functions append journal entries into journal files. It is obvious that all operations on a given database table must be recorded to the same journal file. Otherwise the script writers have to decide how many journal files to use.

Scripts should do journaling in the following way:

  • Open the journal file for appending.
  • Call a function to make the journal entry.
  • Close the journal file.

This is so even though the functions that add journal entries expect file handles, and the reason is that file handles are small integers and as such accessible to anyone writing scripts. Also keep in mind that F_CLOSE_ALL_FILES() really closes all open files.