start_transaction



Summary

#include <dataman/dataman.h>

start_transaction();

Description

This function marks the start of a transaction. Any changes to the database are not written until a commit is called. There are two ways to terminate a transaction the first is commit, and the second is rollback. Commit will cause the database to be updated, and rollback cancels the transaction and writes nothing to the database.

Example

    #include <dataman/dataman.h>

    main(int argc, char *argv[])
    {
            ....
        start_transaction();
            ...
        get(ix1, key) else {
            rollback();        /* couldn't get the key, rollback */
            return;
        }
            ...
        commit() else {
            pause(10,30, "Couldn't commit transaction");
            return;
        }
    }


«previous  next»