ObjectStore C++ Release Notes

Chapter 1

New in Release 5.1

The information in this and succeeding chapters is intended for use by sites upgrading from ObjectStore Release 5.x to Release 5.1. If you are upgrading from an earlier release than ObjectStore Release 5, read the ObjectStore C++ Interface Release Notes supporting that upgrade for pertinent information.

The new features included in ObjectStore Release 5.1 expand product capabilities in several important directions. This chapter summarizes the new features in the following order:

About This Release

ObjectStore is an object-oriented database management system suited for rapid application development and deployment in multitiered environments. It combines the data query and management capabilities of a traditional database with the flexibility and power of C++ and Java interfaces on all platforms. Additionally, ObjectStore for Windows offers support for the ActiveX interface.

This chapter provides general information about the release. Specific distributions of ObjectStore Release 5.1 for various platforms can be found in the README.txt file in the ObjectStore root directory. Solaris SPARC and Windows are supported for the release of ObjectStore Release 5.1.

Be sure to read all of the ObjectStore C++ Interface Release Notes before beginning the installation.

Product Modules

ObjectStore Release 5.1 comprises the C++ and Java interfaces, plus ActiveX support on Windows platforms.

Platforms and Compilers

The README file for this release itemizes the platforms on which the C++ interface to ObjectStore Release 5.1 is currently available, or where its availability is planned. You can also contact Object Design Technical Support for current information.

ANSI C++ Exceptions

The ObjectStore Release 5.1 C++ interface will support the use of ANSI C++ exceptions on the following platforms:

It is Object Design's intention to support ANSI exceptions on all supported platforms in a future major release of ObjectStore. After support for ANSI exceptions is universal, the TIX exception mechanism will be obsolete and ultimately will not be supported.

Upcoming Changes

os_database::open and close
Previously and in the ObjectStore Release 5.1 the functions for creating, opening, and closing databases can be called either inside or outside a transaction. For example, you can do an open update followed by an open read-only. This behavior will not be supported in the next major release. In the future, consecutive opens or closes must be of the same type. For example, a close read-only can only be followed by another close if it is also a close read-only.

os_database::close or destroy
Also in the next major release, the function for destroying or closing databases must be called outside a transaction.

access hooks
The next major release of ObjectStore will introduce an upward incompatible change to the access hooks feature of ObjectStore C++. This change will make it necessary to modify the source and potentially the logic of ObjectStore Release 5.1 applications that use the access hook facility. The affected API is os_database::set_access_hook.

union discriminant functions
Union variants will be supported in a different manner in the next major release.

New Features

Component Server Framework

This new capability addresses a basic need to provide documentation, code examples, and general classes that enable application writers to develop a class of applications called application servers. An application server is basically the processing engine for thin client front-end applications. See the ObjectStore Component Server Framework User Guide for detailed information about this new feature.

Dump/Load

This new subsystem provides a facility to enable ObjectStore users to dump and load databases into and from a nondatabase format. For specific details see The Dump/Load Subsystem, in Chapter 1, Overview of Managing ObjectStore; Chapter 4, Utilities, in ObjectStore Management; and Chapter 8, Dump/Load Facility, in the ObjectStore Advanced C++ API User Guide.

Component Schema for DLL Use

This feature allows for incremental loading and unloading of schema at run time. This functionality enables building applications that consist of component DLLs and their associated schemas. Component schema functionality is described in the ObjectStore Advanced C++ API User Guide and ObjectStore C++ API Reference.

X/Open's XA Transaction Processing Standard Is Supported

In Release 5.1, ObjectStore clients and Servers can support X/Open's transaction processing standard (known as XA). The implementation of this interface is layered on top of the existing ObjectStore client library. An ObjectStore client can now act as a Resource Manager (RM). For more information, see Support for the XA Standard for Transaction Processing.

Address Space Reset

This feature allows applications to release address space that was assigned during the execution of a transaction. The existing ObjectStore entry point objectstore::release_address_space() is extended so that it can now work within a transaction. There is also a mechanism for keeping certain address space assigned. This mechanism is built using pvars and a new facility implemented with the os_retain_address class.

For further discussion, see Controlling Address Space Usage During a Transaction.

Reduced Address Space Consumption in Queries

In earlier releases of ObjectStore, queries on very large collections could terminate because address space ran out. In this release, the ObjectStore query facility includes two new memory modes that automatically release address space and allow you to create queries that will never run out of address space.

For further discussion, see Address Space Usage with Queries.

Dynamic Extents

Dynamic extents are a mechanism for treating all objects of a particular type in a segment or database as a collection. The new class os_dynamic_extent is used for this.

For more information, see os_dynamic_extent Class.

String Conversion for Asian Language String Encodings

A new facility for converting Asian language string encodings is available in this release. See os_str_conv for details. See also Conversion Between Asian Language String Encodings.

Bit Vector-Assisted Relocation

An optimization to relocation in ObjectStore Release 5.1 is the use of a bit vector to assist in the relocation of pages (in or out) that have already been relocated in once, and are still in the cache.

osgc Utility Capabilities

The ObjectStore garbage collection utility, implemented to support the Java interface to ObjectStore, can now be used with ObjectStore C++ with some restrictions. The ObjectStore persistent garbage collector (GC) collects unreferenced objects and ObjectStore collections in an ObjectStore database and frees space associated with these objects.

The osgc utility removes all data from the database that cannot be navigated to from a root or a protected reference. If your database is pointed to by cross-database pointers, cross-database references, or dumped or transient references, you cannot safely run osgc on it unless you ensure that each object referred to by any of the above is also the target of a root or protected reference in the database on which you intend to use the osgc utility.

osgc Release 4 databases
osgc is supported only on databases initiated in Release 5 or later. Databases upgraded from previous releases are not supported, and using osgc on them can corrupt them.

You can successfully use the osgc utility on databases from previous releases that have been dumped and reloaded to a Release 5 or later database using osdump and osload. See osdump: Dumping Databases and osload: Loading Databases in Chapter 4 of ObjectStore Management. See also Chapter 8, Dump/Load Facility, in the ObjectStore Advanced C++ API User Guide.

Databases containing schema information about template instantiations (including information about ObjectStore templated collection types) inadvertently contain unreferenced objects that osgc will remove. This is safe and will not affect correct operation.

It is safe to use osgc concurrently with other applications that modify the database. It is not safe to run more than one osgc on a database at the same time. See osgc: Garbage Collection Utility in ObjectStore Management for further information.

Documentation Enhancements

The ObjectStore Release 5.1 documentation is enhanced in content and form. The improvements are listed in the paragraphs that follow.

Clarification of Functionality

There is new documentation for previously existing ObjectStore features. The following paragraphs provide cross-references to the new information in other books in the ObjectStore Release 5.1 documentation set.

Collections documentation Improvements
Significant updates and clarification of the collections discussions in ObjectStore Collections C++ API Reference appear in the ObjectStore Release 5.1 documentation.

os_rDictionary
Added information about os_rDictionary is available in the ObjectStore Collections C++ API Reference. See os_rDictionary for details.

Checkpoint/refresh
There is new information about how transactions work with checkpoint/refresh in the ObjectStore Advanced C++ API User Guide. See Checkpoint: Committing and Continuing a Transaction for details.

Additions to the
os_mop class
os_mop::current, os_mop::find_name, and os_mop::reset Previously undocumented, these are now included in the ObjectStore C++ API Reference.

Installing the On-Line Documentation

To install the ObjectStore full-text-searchable documentation, unpack the documentation distribution by doing one of the following:

For root installation
If ObjectStore has been installed as root, $OS_ROOTDIR is write protected. Therefore, you must complete the following steps.

# chmod +w $OS_ROOTDIR
# cd $OS_ROOTDIR/..
# uncompress -c /cdrom/packages/ostore/doc_sol2.tar.Z | tar xvf -
# chmod -w $OS_ROOTDIR
For non-root installation
If ObjectStore has been installed using the non-root option, the owner/installer has write permission in $OS_ROOTDIR (and all subdirectories) so the chmod command is unnecessary. In this case, do the following steps.

# cd $OS_ROOTDIR/..
uncompress -c /cdrom/packages/ostore/doc_sol2.tar.Z | tar xf - 
osji documentation note
Do not install the Java documentation until you have completed the ObjectStore documentation installation.

When you run the ossearch command the first time, you will be asked whether to install it. After it installs, and on future invocations of ossearch, it will launch the configured browser on the root of the documentation tree.

Browser warnings
When you invoke the search application, you might see a stream of warnings before the browser actually appears. These complaints are associated with the release of X11 the application expects. If you are running X11 R6, no such warnings appear.

Viewing the On-Line Documentation

The documentation for ObjectStore Release 5.1 is distributed in machine-readable HTML format and PDF. The HTML format uses HTML frames, so JavaScript must be enabled. To view the documentation from a browser on UNIX, in the
$OS_ROOTDIR/.. directory, run the ossearch utility. This displays the catalog of ObjectStore documentation components.

On Windows platforms, you can invoke the searchable documentation from the ObjectStore Win32 group with the ObjectStore Documentation icon. In either case, your browser appears with a top index displayed. Select the documentation or bookshelf you want as usual.

You can search the entire ObjectStore Release 5.1 documentation set from the top-level bookshelf search button for each interface (for example, 5.1.0.0.0/ostore/doc/index.htm). Once you have selected a book, you can search the rest of its documentation set by selecting the search button in the navigation bar above the book text frame.

Search by entering a word or series of words separated by commas in the query box and pressing the Return key. If you are uncertain about how to enter a query, you can refer to an on-line search query guide by clicking on the string to learn additional query methods that appears in the search form.

Changes and Additions to the C++ Interface

The following paragraphs summarize modifications to the C++ interface.

Changes to the API

The following functions are now callable within top-level transactions, as well as outside top-level transactions. In the previous release, they were callable only outside top-level transactions.

      static void objectstore::retain_persistent_addresses();
      static void objectstore::release_persistent_addresses();
      static void objectstore::get_retain_persistent_addresses();

Additions to the API

The following functions have been added for this release. They make certain aspects of controlling address space behavior more explicit:

static void objectstore::set_retain_persistent_addresses(
      os_boolean value);
static void objectstore::reset_persistent_addresses(); 
static void objectstore::release_persistent_addresses(
      os_boolean force);
These new functions are introduced to make explicit the distinction between disabling the retain behavior (done by calling objectstore::set_retain_persistent_addresses() with the value argument false) and deassigning address space (done by calling objectstore::reset_persistent_addresses()).

Controlling Address Space Usage During a Transaction

ObjectStore Release 5.1 introduces the ability to release address space during a transaction. In earlier releases, all address space assignments made during a top-level transaction were retained until the transaction was completed.

As with top-level transaction boundaries, when objectstore::retain_persistent_addresses is not in use, releasing address space during a transaction requires that the application drop pointers to persistent memory locations that are released.

Restrictions

Changes to the API

The following functions can now be called within top-level transactions, as well as outside top-level transactions. In the previous release, they were callable only outside top-level transactions.

      static void objectstore::retain_persistent_addresses();
      static void objectstore::release_persistent_addresses();
      static void objectstore::get_retain_persistent_addresses();

Additions to the API

The following functions have been added for this release. They make certain aspects of controlling address space behavior more explicit:

static void objectstore::set_retain_persistent_addresses(
      os_boolean value);
static void objectstore::reset_persistent_addresses(); 
A new argument, os_boolean force, has been added to objectstore::release_persistent_addresses()

static void objectstore::release_persistent_addresses(
      os_boolean force);
These new functions are introduced to make explicit the distinction between disabling the retain behavior (done by calling objectstore::set_retain_persistent_addresses() with the value argument false) and deassigning address space (done by calling objectstore::reset_persistent_addresses()).
New FunctionEquivalent 5.0 Function
objectstore::set_retain_persistent_addresses(true)
objectstore::retain_persistent_addresses() 
objectstore::set_retain_persistent_addresses(false) 
and objectstore::reset_persistent_addresses()
objectstore::retain_persistent_addresses() 
objectstore::reset_persistent_addresses()
No equivalent in release 5.0

Calling objectstore::retain_persistent_addresses() is equivalent to calling objectstore::set_retain_persistent_addresses(true) or to calling objectstore::set_retain_persistent_addresses(false) and objectstore::reset_persistent_addresses().

Functionality associated with objectstore::reset_persistent_addresses() alone is new in Release 5.1.

Calling objectstore::retain_persistent_addresses() or objectstore::set_retain_persistent_addresses(true) within a transaction is no different from calling either of them before the transaction. All that these functions do is turn on a flag specifying that the client not perform a release automatically at the end of the top-level transaction. This flag can be turned on at any time.

Calling objectstore::release_persistent_addresses() with the force argument true is equivalent to calling release on all existing mechanisms that are retaining address space.

objectstore::get_address_space_generation_number()

Address Space Generation Number
os_unsigned_int32 get_address_space_generation_number()
This function returns an unsigned integer that is incremented by the client whenever it releases any address space. Its primary purpose is to support pointer caching, such as that used by ObjectStore collections in several circumstances. A transient cache of persistent pointers should be considered invalid whenever the value of objectstore::get_address_space_generation_number() increases. The objectstore::get_address_space_generation_number() function simply returns the value read from a variable, and so is fast enough to be called whenever a pointer cache is examined.

os_retain_address Class

The class os_retain_address allows an application to specify that certain address ranges be kept assigned across calls to objectstore::release_persistent_addresses() and top-level transactions.

See os_retain_address in ObjectStore C++ API Reference for further information.

Use of pvars with os_retain_address
Instances of os_pvar are treated specially by the address release operation when called within a transaction. Any such os_pvars that are active when address space is released act like instances of os_retain_address - the persistent address that they refer to continues to be assigned. However, unlike os_retain_address, active os_pvars do not hold address space across transaction boundaries when objectstore::retain_persistent_addresses() is not operating.

objectstore::set_retain_address() and objectstore::get_retain_counter()

The static functions objectstore::set_retain_address() and objectstore::get_retain_counter() can be used to retain and release individual address ranges. Each address range maintains a retain_counter that is initially 0. The function signatures are

static void objectstore::set_retain_address(
      void *address, os_boolean value = true);
static os_unsigned_int32 objectstore::get_retain_count(
      void *address);
Calls to objectstore::set_retain_address() with value = true on any address in the range will increment the counter. Calls to objectstore::set_retain_address() with value = false on any address in the range will decrement the counter (if it is greater than 0). Calling objectstore::get_retain_count on any address in a range returns the current value of the counter for that range.

Whenever a range has a retain count greater than zero, that range will not be released by any release operations (except a force release operation).

Incremental Release of Address Space: os_address_space_marker Class

The objectstore::release_persistent_addresses() call releases address space reserved since the beginning of a transaction, or since the last call to objectstore::retain_persistent_addresses(). Obviously, releasing all address space is something only the application can do directly, since the application must make sure that transient pointers to persistent objects get dropped.

However, there are certain address-space-consuming features that would benefit from having the ability to release address space in a manner that is transparent to the application. The primary example of such a feature is a collections query. During a query, address space might be consumed in large quantities. A new class, os_address_space_marker, provides the ability for a query to release the extra address space it consumed that is not required by the application outside the query. This allows queries that detect the address space full condition (err_address_space_full) and use this scheme to release the address space they have consumed and continue, to examine more objects than could fit into address space at any one time.

See os_address_space_marker in the ObjectStore C++ API Reference for a description of this class.

Interactions Between Different Address-Space Mechanisms

The different APIs for controlling address space can be ordered by the specificity (least to most) of the target address space, as follows:

      objectstore::retain_persistent_addresses() 
      objectstore::release_persistent_addresses() 
      objectstore::reset_persistent_addresses() 
      objectstore::set_retain_persistent_addresses() 
      os_address_space_marker class
      os_retain_address  
      os_pvar 
      objectstore::set_retain_address 
For cases where several address space mechanisms are in place, the rule is that the more specific calls take precedence. The only exception is the force form of objectstore::release_persistent_addresses(), which causes all the mechanisms in effect at the time of the call to release. For calls at the same level of specificity, the retains take precedence over releases.

Example
Constructing an os_retain_address on a variable pointing to address A, followed by calling objectstore::_reset_address on A, will not result in A's being released. (This is the same level of specificity rule that says that retains take precedence over releases.)

Related Functions

Two functions related to controlling address space allocation are available in Release 5.1:

objectstore::get_unassigned_address_space()
static os_ptr_val objectstore::get_unassigned_address_space();
Returns the total amount of address space that is still available for assignment. The value returned is always a multiple of 64 KB.

objectstore::get_largest_contiguous_unassigned_address_space()
static os_ptr_val objectstore::
      get_largest_contiguous_unassigned_address_space();
Returns the size of the largest contiguous region of address space that is still available for assignment. The returned value is always a multiple of 64 KB.

Address Space Usage with Queries

In earlier releases of ObjectStore, queries on very large collections could terminate because address space ran out. In this release, the ObjectStore query facility includes two new memory modes that allow you to create queries that will never run out of address space. You can control this behavior with the new function os_collection::set_query_memory_mode(). Specify the enumerator os_query_memory_mode_none if you want queries to use memory mode as they did in Release 5.0.

Customizing Address Space Usage in Collections

ObjectStore provides the following two classes for use in customizing address space usage with collections.

os_reference_cursor Class

Creates a transient reference-based list (os_packed_rlist) from any type of collection that can be iterated over using the member functions.

class os_reference_cursor {

public:
      // This is the public reference based API to this class
      os_reference * first();
      os_reference * last();
      os_reference * next();
      os_reference * previous();
      os_reference * retrieve();
      os_int32 more() const;
      os_int32 null() const { return !more(); };

      // Versions of functions that automatically check for
      // err_address_space_full
      void * retrieve(os_address_space_marker &);
      void * first(os_address_space_marker &);
      void * last(os_address_space_marker &);
      void * next(os_address_space_marker &);
      void * previous(os_address_space_marker &);

      // construction
      os_reference_cursor(os_collection *, os_unsigned_int32 flags = 
0);

      // Destruction
      ~os_reference_cursor();

os_cursor_holder Class

Remembers the position of the cursor in the collections after a call to os_collection::release_address_space has been made.

class os_cursor_holder
{

public:
      // The public interface to os_cursor holder
      os_cursor_holder(os_cursor * cursor);
      os_cursor_holder(os_dictionary_cursor * cursor);
      os_cursor_holder();
      ~os_cursor_holder(); 
      void remember();
      void remember(os_cursor * cursor);
      void remember(os_dictionary_cursor * cursor);
      void restore();
      void init();
};

Using Component Schemas

ObjectStore Release 5.1 includes a new set of features that allow you to write applications that use DLLs (dynamically loaded and associated schemas).

A component schema, also referrred to here as a DLL schema, is a self-contained schema associated with a DLL. It plays the same role for the DLL as an application schema plays for an application. Like a DLL, and unlike an application schema, a DLL schema can be loaded and unloaded dynamically at run time. Unlike the application schema, multiple DLL schemas can be in effect at the same time in a single program. The file name extension .adb is used for both application schemas and DLL schemas. DLL schemas are generated by ossg just as application schemas are.

For further information, see

In ObjectStore C++ API User Guide, see Chapter 11, Component Schemas.

In the ObjectStore C++ API Reference, see the new classes os_DLL_finder, os_DLL_schema_info, os_schema_handle, os_schema_info, and additions to the classes objectstore and os_database.

Support for the XA Standard for Transaction Processing

ObjectStore supports X/Open's transaction processing standard (known as XA). For further information see Support for the XA Standard for Transaction Processing in the ObjectStore C++ API User Guide.

os_dynamic_extent Class

Derived from os_Collection, an instance of this class can be used to create an extended collection of all objects of a particular type, regardless of which segments the objects reside in. All objects are retrieved in an arbitrary order that is stable across traversals of the segments, as long as no objects are created or deleted from the segment, and no reorganization is performed (using schema evolution or compaction).

For further information see os_dynamic_extent in the ObjectStore C++ API Reference.

Conversion Between Asian Language String Encodings

There are many standards for encoding Asian characters. In Japan, for example, five encodings are in broad use: JIS, SJIS, EUC,
Unicode, and UTF-8.

Usually an application uses one encoding for all strings to be stored inside a database. The encoding chosen is most often the one used in the operating system of the ObjectStore client.

However, if the application has heterogeneous clients using a variety of encodings, conversion from one encoding to another is necessary at some point. The clients could be traditional ObjectStore client processes or thin-client browsers that emit data in different encodings.

This release of ObjectStore provides conversion facilities for various Japanese language text encoding methods: EUC, JIS, SJIS, Unicode, and UTF8. For more information, see Using Asian Language String Encodings in the ObjectStore C++ API User Guide and os_str_conv in the ObjectStore C++ API Reference.



[previous] [next]

Copyright © 1998 Object Design, Inc. All rights reserved.

Updated: 04/15/98 15:15:40