Specifying Flags for db_open()

You can use a number of LIBMAKE directives to control how the init() function generated for C programs opens the database:

#exclusive

LIBMAKE passes the EXCLUSIVE flag in the generates call to db_open().Your program will only run if no other programs are using the database, and will prevent other programs opening the database while it is running.

#no_logging

This directive adds the value NO_LOGGING to the flags with which db_open() is called. This flag only works for programs that also specify #exclusive

#private

This directive adds the value PRIVATE_DB to the flags with which db_open() is called, and enables the private database facility. The private database facility can impact performance, especially for programs that create very big transactions, but allows programs to consistently see the database as it will be if committing the current transaction succeeds.

#quit

This directive adds the value QUIT_ON_FAILURE to the flags with which db_open is called.

Using this directive means your program will always terminate if a commit failure condition is encountered. It should only be used if commit failures should not arise in practice, or when prototyping a program.

#read_only

This directive adds the value READ_ONLY to the flags with which db_open is called.

#shared

This directive adds the value SHARED to the flags with which db_open() is called, enabling multiple programs to open the data simultaneously. In fact SHARED has the value 0 so there is no need to specify this directive explicitly.