class lrid_t; #include <lid_t.h>
The Shore Value-Added Server uses logical
record identifiers,
which we call an
object identifier (OID)
An OID comprises a
logical volume identifier
and a
serial number
A serial number is a set of bits (identity) that the SSM assigns to entities on a volume. Serial numbers are used for SSM files, indexes, and records (objects), and other things internal to the SSM. Serial numbers, once associated with an entity, are never reused for another entity. The serial number in an object's OID is the serial number that the SSM associates with the record in which the object is stored.
A complete reference to an object consists of its full logical object identifier, which is rather large. Many references, however consist only of the serial number, because context is present: the volume on which the object resides is known. When Shore objects are committed to the disk, all references are stored in the form of a serial number. References to objects on another volume, called off-volume references or indirect references are managed as follows. (Keep in mind that this discussion pertains only to value-added servers that use logical identifiers.)
Remember that the SSM maintains a mapping of logical object identifiers to their physical object identifiers. In fact, it maintains a mapping on each volume, whose domain is the serial numbers, and whose range is all logical record identifiers, the physical record identifiers on the volume, combined. In other words, a serial number can be mapped to any logical object identifier, including one that refers to an object on another volume. This scheme allows chains of references to be built. It also permits indirect (and inefficient) references to local objects. The Shore Value-Added Server and the Shore Object Cache reduce these chains by snapping (reducing to a direct reference) references when appropriate. Nevertheless, it is beneficial to avoid inter-volume references in a database altogether.
A serial number is specified by the C++ class
serial_t
#include <serial_t.h>The class has methods to tell if the serial number is null, remote, or local. The data portion of the class is a C structure, found in
#include <serial_t_data.h>The data portion of a serial number has the same form as an in-memory address, and contains 32 or 64 bits, depending on a compile-time configuration option. In either case the following bits of an address have special meanings: