This sample demonstrates basic eXtremeDB Transaction Logging functionality. When it is run the first time (with no database snapshot and log file on disk) the sample creates a database and makes a database snapshot file. Then it starts transaction logging and begins to perform some read-write operations on the database. Then it closes transaction logging and the database leaving the initial database snapshot and log with all transactions on disk.
When the sample is run a second time it finds the database snapshot and log on disk, so it opens the snapshot and applies the log. This restores the database to the same status as at the end of the previous run. Now the sample makes a new database snapshot, starts transaction logging and performs more operations on the database as in the first run.
Each successive run of the sample will update the database stored on the previous run with a portion of new data. This demonstrates how to make an in-memory database persistent and automatically restore-able.
See instructions here on how to build this and other samples on your development platform. Once built, the sample can be run from the
\target\bin
directory:tlogbasicBut it is more instructive to run it in your development environment debugger, stepping through the code.