Persistent Database Recovery from Failed Processes in C#

Persistent database recovery can be necessary in the case of a system failure. The eXtremeDB runtime uses the transaction log file to perform recovery automatically when Database method Open() is called.

Note that, for automatic recovery, it is important that either the RedoLog (the default) or UndoLog log file type was active in the process that was updating the database at the moment of the system failure. In other words, if the log file type was NoLog in the crashed process, recovery will not be possible. The log type is specified in Database.Parameters.LogType. For example:

 
    Database.Parameters parameters = new Database.Parameters();
    ...
     
    // Set log file type
    parameters.LogType = Database.LogType.UndoLog;
     

No additional API or action by the application is necessary for automatic recovery.