1.77.6 Embedded Server

The Embedded Server version is optimized for running on small board computers as a database back-end for a single client. It is of particular interest if you need database functionality within a limited application setting, e.g a self-contained database distributed as part of the application. Within this context, much of the code to facilitate and protect concurrent use of the kernel can be disabled. For example, locking of critical resources in the kernel is not needed anymore, which results in significant performance improvements.

The approach taken is to wrap a server such that the interaction between client code and server can still follow the Mapi protocol. It leads to a C-program with calls to the Mapi library routines, which provides some protection against havoc behaviour. From a programming view, it differs from a client-server application in the startup and (implicit) termination.

You normally only have to change the call mapi_connect() into embedded_sql() (or embedded_mal()). It requires an optional argument list to refine the environment variables used by the server. In combination with the header file embeddedclient.h it provides the basis to compile and link the program.

The behavior of an embedded SQL program can be simulated with a server started as follows:

     mserver5 --set embedded=yes --dbinit="include sql;" &

As a result, the server starts in 'daemon' mode, loads the SQL support library, and waits for a connection. Only one connection is permitted.