ObjectStore/Single is a form of the ObjectStore client tailored for single-user, nonnetworked use. The functional capability of an ObjectStore/Single application operating on file databases is virtually identical to that of a full ObjectStore client. Databases created with one kind of client are completely compatible with the other. However, full ObjectStore and ObjectStore/Single are not intended to run together.
ObjectStore/Single Features
Each invocation of an ObjectStore/Single application requires a Server log file. Applications for UNIX platforms also require a cache file. ObjectStore/Single applications normally supply these files automatically. ObjectStore/Single API
The following functions in the class objectstore can be used in creating ObjectStore/Single applications. C++ API Reference describes these functions in detail.
For ObjectStore/Single, specify the following:
| Platform | Library Load Path |
| UNIX | $OS_ROOTDIR/libsngl/:$OS_ROOTDIR/lib |
| Windows | %OS_ROOTDIR%\binsngl |
Application Development Sequence
You can use two environment variables for proof of concept when you want to convert a full ObjectStore application to an ObjectStore/Single application. These environment variables are strictly for development purposes and are not supported if included in your final application. See Additional Considerations for a discussion of the issues involved in using these environment variables.
The two environment variables are
The user must take responsibility for ensuring that the Server log information is propagated when moving a database from a full ObjectStore environment to ObjectStore/Single, or the reverse.
ObjectStore/Single provides transaction consistency for databases just as full ObjectStore does. Both ObjectStore/Single and full ObjectStore use a Server log as a tool to provide transaction consistency. See Description of the Server Transaction Log in Chapter 1 of Managing ObjectStore for additional information about Server logs.
In this discussion, the term Server refers to both the separate osserver process of full ObjectStore and the functionally equivalent part of ObjectStore/Single contained in the client library. The term is meaningful for ObjectStore/Single because while ObjectStore/Single does not have or need a separate-process Server, the requisite work is done in a part of the client library internals known as the embedded Server.
Server Log Functions
You must be aware of several important aspects of Server logs. Commit compared to propagation
A log might contain data that has been committed but not yet written to one or more databases. Logically, the log information is part of the databases, so it must be propagated, that is, written into the actual databases, before those databases can be used for more work. Users of full ObjectStore might have encountered this issue when trying to copy file databases with an operating system command such as cp rather than oscopy. Server log size
Server logs can grow large fairly quickly. As a general rule, a log's size is proportional to the amount of data that has been modified in the largest transaction since that log was created. The Server cannot shrink its log. The log size is generally not a problem for full ObjectStore because there is only one log file per osserver process. However, in ObjectStore/Single, because each execution of an ObjectStore/Single process must have its own log, the log size can quickly become a disk space management problem. Thus you must be conscientious about finding and propagating (and thereby removing) old log files. Log File Guidelines
The following ObjectStore behaviors help you deal with logs:
For some applications, setting this environment variable to true can improve performance because data is written to the database less frequently. However, it increases the risk of data loss, which can happen if an application ends prematurely and the transaction log is deleted before the data is propagated to the database.
Applications can override this environment variable by using . For more information, see objectstore::get_propagate_on_commit() and objectstore::set_propagate_on_commit()in ObjectStore C++ API Reference.
Updated: 03/10/99 16:38:57
When to Intervene
An ObjectStore/Single application (or any of the ObjectStore/Single utilities) tries to ensure that all the data in its Server log is propagated and that the log is removed before the application exits. Important note
The absence of a log after the program ends is both normal and a guarantee that all committed data is physically in the affected databases.
Copyright © 1999 Object Design, Inc. All rights
reserved.