This chapter briefly describes the architecture of ObjectStore and provides an overview of management tasks. For an introduction to object-oriented database management, including concepts such as persistence, see the first several chapters of the C++ API User Guide.
Clusters can be normal or huge. If an allocation is less than or equal to 64 KB, it is stored in a normal cluster, which can contain any number of normal allocations, up to a maximum size of 2 GB. If an allocation is greater than 64 KB, ObjectStore creates a huge cluster containing just that one allocation.
The default segment and any additional segments always have a default cluster. ObjectStore normally allocates storage from this cluster. You can create additional clusters using the
File Databases
A file database is a native operating system file that contains an ObjectStore database. You can, with some restrictions, manipulate file databases with standard operating system commands as well as with ObjectStore utilities described in this book. A file database has a standard operating system pathname. Rawfs Databases
A rawfs database is a database that you store in an ObjectStore rawfs. A rawfs (raw file system) is a private file system managed by the ObjectStore Server. It is independent of the file system managed by the operating system. Rawfs partitions
On UNIX platforms you specify each partition in the rawfs with a Partitionn statement in the Server parameter file. On Windows platforms you specify partitions using the ObjectStore setup.exe utility. Each partition can be either
When you create a rawfs database, you specify a pathname. The Server determines where in the rawfs to store your database. Thus, the logical directory structure might not map directly to the physical placement of the databases in the partitions. For example, two rawfs databases in different ObjectStore directories might be stored in the same partition.
hostname::/database_pathnameA double colon separates the host name from the database pathname. The name of a rawfs database always starts at root; it is never relative to a working directory. Slashes always separate the levels of a rawfs database name, regardless of the platform. Case is significant. For example, the following two pathnames identify different databases:
hostess::/accounts/payable/JUNE hostess::/accounts/payable/juneYou can create a rawfs during ObjectStore installation or at any time after installation. SeeChapter 7, Managing ObjectStore on UNIX, or Chapter 8, Managing ObjectStore on Windows, for more information about how to create a rawfs.
How Do Objects Get into a Database?
When an application allocates an object in persistent storage, it specifies the database to contain that storage. The member functions create, lookup, and open of the os_database class are responsible for creating databases. You name the database in a pathname argument to the function that creates the database. How ObjectStore Controls Storage
The Server is the ObjectStore process that primarily controls object storage. With help from the client process and the Cache Manager process, the Server can manage databases for multiple client applications. These applications can be on one or multiple hosts. What Does the Server Do?
The ObjectStore Server is a process that controls access to ObjectStore databases on a host. This includes
Typically, a Server must be running before any ObjectStore application can access databases on the host. (A locator file allows access to databases residing on a host that is not running a Server. See Chapter 5, Using Locator Files to Set Up Server-Remote Databases, for further information.)
An application can use databases that are stored on different hosts and managed by different Servers. A Server can serve clients on any number of hosts.
Multiple Servers on a host
A host can run one Server of a given ObjectStore release. You can run two ObjectStore Servers on the same host if they are different versions of ObjectStore. For example, you can run a Release 6 and Release 5 Server on the same host. Start them on different ports and use the ports file to let clients know the one to contact. See Modifying Network Port Settings for details.
A network can have a number of Servers.
What Does the Client Application Do?
ObjectStore links the client library into each ObjectStore application. In this way, each ObjectStore application is an ObjectStore client that
To change the default size of the client cache, use the OS_CACHE_SIZE environment variable. See OS_CACHE_SIZE.
When a client application needs an object stored in a database it dereferences a pointer (or object reference in Java). If the page that holds the object is already in physical memory or if the page is in the cache with the appropriate permission, access is immediate.
UNIX
By default, ObjectStore places the cache file in the /tmp/ostore directory. To change the default, specify an alternate directory for the OS_CACHE_DIR environment variable, or set the Cache Directory parameter in $OS_ROOTDIR/etc/host_cache_manager_parameters. Windows
The operating system determines the location of the cache in virtual memory. You cannot change the location. The cache is not a file; it is a region of virtual memory. The necessary storage is obtained from system virtual memory, which consists of physical memory plus swap file space. What Does the Cache Manager Do?
The primary function of the Cache Manager is to facilitate concurrent access to data by handling callback messages from the Server to client applications. Note that the Cache Manager never reads the cache itself. The Cache Manager coordinates access by clients to cached data. Callbacks
When a client requests permission to read a page and no other client has permission to modify that page, the Server grants read permission (read ownership). The Cache Manager is not involved.
The Server cannot send callback messages directly to the client because the client might not be listening; the client might be busy running the application. The Cache Manager determines whether the read or write permission can be released or whether the client requesting permission must wait.
If you are running an ObjectStore application that uses a database that nobody else is using, there are no callback messages for that database.
For information about ownership and locks, see Callback Messages Background.
Commseg
The commseg (communications segment) is a shared-memory object where the client and the Cache Manager maintain information about permissions on pages and whether the client is actually using the page. Each client has its own commseg. For every page in the cache, there is a corresponding item in the commseg. UNIX
By default, ObjectStore places the commseg file in the /tmp/ostore directory. You can specify an alternative directory by setting the OS_COMMSEG_DIR environment variable. Another way to change the default is to set the Commseg Directory parameter in the $OS_ROOTDIR/etc/host_cache_manager_parameters file. Windows
The operating system determines the location of the commseg in shared memory. The commseg is not a file; it is a region of virtual memory. The illustration that follows shows one possible configuration of ObjectStore processes.
Managing Processes
ObjectStore includes three main processes that communicate with each other to manage your data:
ObjectStore uses network connections to communicate among Server, client, and Cache Manager processes. The kind of network connection used depends on your platform. Typically, you need not modify network connections. However, if you do need to make changes, see Modifying Network Port Settings.
Starting ObjectStore Processes
Server
The chapter supporting your platform provides instructions for starting the Server on your platform. Typically, the installation procedure arranges for the Server to be started automatically when the system is booted.
There are many Server parameters you can set to determine the behavior of the Server. Chapter 2, Server Parameters, describes each parameter. When you modify a parameter, you must shut down and restart the Server for the parameter to take effect.
Client
When a client application starts, it tries to connect to the Cache Manager on that machine. If a Cache Manager is not running, ObjectStore starts one. Cache Manager
The Cache Manager starts automatically if one is not already running when a client application starts. Windows NT
On Windows NT, the Server and Cache Manager typically run as NT Services. You can use the Services applet in the Control Panel to start and stop the Server and Cache Manager and to determine whether they start automatically when you boot the system. Stopping ObjectStore Processes
Server
You need to shut down the Server
Dangling clients are clients still attached to the Server, even though they no longer exist. This can happen when a client is halted abnormally rather than being stopped in the usual manner. See ossvrclntkill: Disconnecting a Client Thread on a Server.
If necessary, you can use the ossvrclntkill utility to sever the connection between a client and the Server. This disconnects the client. See ossvrclntkill: Disconnecting a Client Thread on a Server for details.
Cache Manager
Before you shut down the Cache Manager, notify clients that you are shutting it down, then use the oscmstat utility to confirm that there are no active clients. See oscmstat: Displaying Cache Manager Status. Use the oscmshtd utility to shut down the Cache Manager. See oscmshtd: Shutting Down the Cache Manager for details. The next client process that starts automatically starts the Cache Manager.
Obtaining Process Status Information
When an ObjectStore daemon process sends output to stdout or stderr, ObjectStore routes the output to a corresponding file. These files have different names on different platforms. See Finding Files Containing ObjectStore Messages in Chapter 7 or Finding Files Containing ObjectStore Messages in Chapter 8.
ObjectStore daemons seldom send messages to these files except under certain unusual error conditions. In these cases, this information can be helpful in understanding and resolving an error. When you report to Object Design a problem that might involve one of these daemons, find such a file if it exists and provide the contents.
Status commands
The ossvrstat utility displays information from a Server. For example:
Use the oscmstat utility to obtain information about the Cache Manager, client cache files, and commseg files. See oscmstat: Displaying Cache Manager Status.
Debugging Cache Manager
Use the following command line to start the Cache Manager in debug mode:
oscmgr6 0 debug-levelFor debug-level, specify an integer from 0 through 50. The higher the number, the more information ObjectStore displays about Cache Manager activity.
Monitoring the Server
You can run the Server in debug mode to obtain information about exactly what is happening. ObjectStore displays messages about process communication that show where the problems are, if there are any.
Debug mode slows down the Server but does not affect clients. Use debug mode only when you are experiencing a problem.
Description of the Server Transaction Log
Each Server keeps a transaction log, also called a log file. The most important function of the transaction log is to prevent database corruption in case of failure. The log contains modified pages of data and the records about modified pages of data. Log file
The log file stores database modifications until they are propagated to the database. The log does not have a fixed size. It can grow to contain as much data as is written to it. You can use the ossvrstat utility to obtain the size of the log. This is described more fully in ossvrstat: Displaying Server and Client Information.
Location
By default, the Server places its log file in the rawfs. Server performance is always better when the log is in the rawfs rather than in a native file system. If there is no rawfs, you must use the Log File Server parameter to specify a pathname for the transaction log. When you use the Log File Server parameter, you cannot place the log file in a raw partition. See Log File.
When the log is in the rawfs, it is not visible to you. Its size is limited by the size of the rawfs. The log can span partitions.
Transactions, commits, and the log
When a transaction modifies databases, either all or none of the modifications are made, depending on whether ObjectStore commits or aborts the transaction. This is true even if the Server machine crashes during the transaction. Propagation
The Server moves committed data from the log to databases through propagation. The information accumulated in the log is propagated from the log to the material (that is, real) database transparently in a way that does not interfere with client performance. After propagation, the space in the log that was occupied by propagated data becomes available for new entries in the log. Sector
A sector is a 512-byte disk block (two sectors equal one kilobyte). When you run the ossvrstat utility, ObjectStore displays many statistics in number of sectors. Log File Size
When the Server recognizes that it needs a bigger transaction log, it increases the size of the log segments according to the Log Data Segment Growth Increment and Log Record Segment Growth Increment Server parameters. See Log Data Segment Growth Increment for details.
When you run the ossvrstat utility, Current log size, in the list of Server parameters, displays the current size of the log. Usually, the log grows to a size that accommodates your application and then stops growing. There usually is no reason to monitor log size or to worry about its allocation. However, if an unusual event causes the log to grow too large, there are ways to make it smaller.
Shrinking the
To move or shrink the log, follow these steps:
log file
This does not actually start the Server; it only reallocates the log. Enter
osserver -ReallocateLog
Warning
Never use -ReallocateLog if the Server is in an inconsistent state. Doing so can cause database corruption. Call ObjectStore Technical Support for assistance. Managing Computer Resources
The computer resources you must manage are your CPUs, memory, disk space, and network. CPUs
Consider the speed of your CPUs. You can run computation-intensive applications on your fastest machines, or you can distribute intensive applications evenly among network hosts. You can also combine these approaches. Memory
ObjectStore uses several kinds of memory. Managing Memory is devoted to effective memory management.
Disk space
Network communications and disk input and output often are the most constraining elements of your installation. Configure your system to minimize network and disk activities. Ensure that applications are designed to minimize this activity. Also, you probably want most of your disks, especially your fastest disks, on the Server.
and network
Managing Memory
To manage the memory that an ObjectStore application uses, you need to understand the concept of address space. What Is Address Space?
ObjectStore transfers an application's data to virtual memory. Data stored in virtual memory can, at any particular time, reside in
Each client process has its own address space. Address space is distinct from virtual memory in that
Each client also has its own transient address space. This space includes all addresses not part of the PSR.
Locations for data
An application's data is stored in virtual memory. This means that data is in one of the following:
When a page of data needs to be brought into physical memory, the operating system often needs to make room by removing another page. When the operating system removes a page from physical memory, it places the page on disk in the appropriate backing store.
If the page contains persistent data, the operating system pages it to the client cache. Each client has its own cache.
If the page contains transient data, the operating system pages it to swap space. Swap space is a disk file or disk partition that is shared by all applications running on the host.
Normally, after a top-level transaction commit or abort, the assignments of persistent space are made available for reuse.
However, if the application is using retain_persistent_addresses(), ObjectStore does not release persistent address space until the program calls release_persistent_addresses().
How Can You Control These Resources?
Persistent address space
Increasing the size of the persistent storage region makes more address space available for a client's persistent data. This allows a transaction to assign more persistent data, which in turn might change a transaction that aborts to a transaction that commits.
Physical memory
You can add physical memory to the machine to lower the reliance on backing store. This increases the performance of all applications (ObjectStore as well as non-ObjectStore) because swapping pages out of physical memory happens less often. Operating systems include tools that help you determine when an application is paging, for example, time and top in UNIX or Performance Monitor in Windows. Client cache
Increasing the size of the cache can improve performance because it decreases the need to send pages containing persistent data back to the Server. You can control the size of the client cache with the OS_CACHE_SIZE environment variable. See OS_CACHE_SIZE.
Swap space
Adding more swap space allows you to run more or larger applications. You can add swap space by following operating system-specific procedures. Some operating systems require a system reboot to accomplish this, while others allow swap space to be added while the machine is running. Your operating system includes a tool for determining the amount of swap space available, for example, pstat -s in UNIX or Control Panel | System in Windows. How Much Memory Is Needed?
The amount of memory your application needs depends entirely on the application. Work with the application developers to understand the application's data structures and data access patterns. Start by using the default settings for the variables that control address space. Use test runs of the application to refine memory allocation. Difference Between Assigning and Mapping an Address
When considering the way a client uses address space, it is important to understand the difference between assigning and mapping an address. Summary of the Kinds of Memory an ObjectStore Application Uses
An ObjectStore application uses three kinds of memory:
Managing the Rawfs
This section presents general information on managing a rawfs in an ObjectStore environment. See Chapter 7, Managing ObjectStore on UNIX, or Chapter 8, Managing ObjectStore on Windows, for more platform-specific information on creating a rawfs.
Advantages
The advantages of a rawfs are that it
osls oscar::/sax/charlie*
See Chapter 7, Managing ObjectStore on UNIX, or Chapter 8, Managing ObjectStore on Windows, for specific instructions about creating a rawfs and starting the Server on your platform. If you decide to reconfigure the rawfs, use that information with these general instructions.
Motivation
You might want to reconfigure a rawfs because you want to
| For Information About | See |
|---|---|
| Soft pointers | Chapter 1, Advanced Persistence, in the Advanced C++ API User Guide |
| Collections | Chapter 1, Introducing Collections, in the C++ Collections Guide and Reference |
| Relationships | Chapter 4, Data Integrity, in the Advanced C++ API User Guide |
Data organization
Managing the physical organization of the data (what is stored next to what) requires knowledge of the application's creation and deletion patterns and clustering directives. For information about creation and deletion patterns, talk to the application developers. For information about clustering, see Chapter 3, Programming with Persistent Storage, in the C++ API User Guide.
Indexes and contention
Managing indexes uses the API, and managing contention sometimes involves the API (for example, controlling locking granularity and lock caching). For information about indexes, see Chapter 7, Using Indexes to Optimize Performance, in the C++ Collections Guide and Reference. For information about controlling locking granularity and lock caching, see Chapter 2, Advanced Transactions, in the Advanced C++ API User Guide.
Managing Databases
To manage databases, you are likely to perform the following typical operations:
Additional utilities for operating on databases are documented in Chapter 4, Utilities.
Pointers and references
Database management is complicated by the fact that a database often
host:/usr/ed/db1 host:/usr/ed/dbs/db2 host:/usr/ed/dbs/db3and they are moved to
host:/usr/fred/db1 host:/usr/fred/dbs/db2 host:/usr/fred/dbs/db3or
hostess:/usr/ed/db1 hostess:/usr/ed/dbs/db2 hostess:/usr/ed/dbs/db3no action is required. If you move one of the set, or change the name of one or more of the databases, you must use the osaffiliate utility to update the others to reflect the change. See osaffiliate: Changing Database Affiliations.
Schema databases
When you are operating on schema databases, you need not identify the data set. A schema database does not have cross-database pointers and references.
Operate on the set
After you identify a data set, you can perform an administrative function on the entire set. If you rename or move an individual database in the set, use the osaffiliate utility described in osaffiliate: Changing Database Affiliations to fix any external pointers and references.
Moving, renaming, and dumping databases
Before moving, renaming, or dumping a database, do the following:
Databases and applications on CDROM
You can place an ObjectStore application on a CDROM and run the application from the CDROM. You can access read-only databases on the CDROM. To do this, you must allocate a Server log on a local writable disk. The Server itself (the executable files that make up the Server) can reside on the CDROM.
Overview of the Backup/Restore Facility
ObjectStore provides the following utilities to back up and restore databases without interrupting production:
On-line backup and archive logging provide these features:
On-line restore and recovery offer these features:
Backup Strategies
When you develop a backup strategy, you need to consider certain conditions of your database environment. The questions to think about include:
With osbackup, you can specify a backup level from 0 to 9. Files that have been modified since the last backup at a lower level are copied to the backup image. For example, suppose that you did a level 2 backup on Monday, followed by a level 4 backup on Tuesday. A subsequent level 3 backup on Wednesday would contain all files modified or added since the level 2 (Monday) backup.
After the backup is complete, the backup images can then be moved to tape and eventually be stored in a safe location. For determining the best backup strategy, it is important that production size databases be estimated. If the databases are not in the gigabyte range, it is better to perform a level 0 (full backup) every night, as opposed to doing additional incremental backups. The advantage is that, in the event of a failure, only a single backup image needs to be restored. The following is a sample backup strategy:
| Sun.: | Backup level 0 |
| Wed.: | Backup level 1 |
| Mon. Tues. Thurs. Fri. Sat.: | Backup level 2 |
For example, if you need to restore the databases on Friday morning, you must restore the backup images from Sunday, Wednesday, and Thursday. It is advisable to save the previous level 0 backup in another location before starting the new level 0 backup.
osbackup command flags
Following is a sample backup command:
osbackup -i bkup_rec.txt -l 0 -f full_bkup.img sample1.db sample2.db sample3.db
Archive Logging
The osarchiv utility takes much smaller pictures of the database than osbackup takes. Object Design recommends that you always run the osarchiv utility, even during an osbackup. The advantage of this is that in the event of a system failure during the osbackup process, no data is lost. The osarchiv utility performs snapshots of pages modified since the previous snapshot or backup. You specify the interval between snapshots. The osarchiv utility records all transaction activity for specified databases.
| YYYY = | Year |
| MM = | Month |
| DD = | Day |
| HH = | Hour |
| ext = | Extension of the form aaa, aab, aac... |
If you decrease the time between snapshots, you also decrease the number of transactions recorded in each snapshot. Using shorter intervals between snapshots has the effect of keeping the archive more up to date and keeping the amount of data that needs to be archived smaller at each interval. However, because each snapshot causes information to be written to the archive file, even if no data modifications are being recorded, frequent snapshots can consume space in the archive file unnecessarily. Longer intervals can reduce the amount of data being logged in cases in which the same data is modified by multiple transactions. In such cases, only the most recent copy of the committed data needs to be logged.
osarchiv command flags
The following is an example of an osarchiv command:
osarchiv -a bkup_rec.txt -d archive_img -i 30 sample1.db sample2.db sample3.dbRemember that the incremental record file created with osbackup is the starting point for osarchiv. In the previous command line example:
Special Considerations for Large Databases
The osbackup procedure backs up approximately 4 GB an hour. The backup can take much longer under certain load conditions, such as when updates are occurring on large numbers of pages while the backup is running. Contrast this time requirement with an operating system backup that averages 20 GB an hour. If you have very large databases to back up, the advantage of an on-line back up with osbackup might be less important than the amount of time it takes to do the back up. You might benefit more from shutting the ObjectStore system down and backing up the file system using operating system commands, as described next. Using a file system backup and the ObjectStore archiver
If you keep the ObjectStore's archiver running while the operating system backup is running, the database is never without a recovery mechanism. The most dependable and least time-consuming method of backing up your data is to depend on the operating system backup and the ObjectStore archiver. The sequence of activities you need to complete is summarized in the following list:
The next paragraphs describe the way osrestore and osrecovr work.
osrestore -f full_bkup.img
osrecovr -F archive_list.txt
C:\name\user>type archive_list.txt
archive_img\1999020719.aaa
archive_img\1999020719.aab
archive_img\1999020720.aac
archive_img\1999020720.aad
archive_img\1999020720.aae
archive_img\1999020720.aaf
To recover to a specific date and time, use a command such as the following:
-F archive_list.txt -D 2/8/1999 -r 19:59:45See osrestore: Restoring Databases from Backups and osrecovr: Restoring Databases from Archive Logs for further explanation of options for these utilities.
Using system backup and osrecovr
Archive image files generated in a directory (specified by the osarchiv -d flag) can be deleted or moved to tape at your discretion. In the event of a failure, you can first restore your UNIX or Windows backup files, then invoke osrecovr with the file name that contains a list of all the archived images in the directory specified by the -d flag. The Dump/Load Subsystem
This subsystem provides a facility that allows ObjectStore users to dump and load databases into and from a nondatabase format.
See osdump: Dumping Databases and osload: Loading Databases for more detailed information about using the dump/load facility. For advanced topics related to customization, see Chapter 7, Dump/Load Facility, in the Advanced C++ API User Guide.
Managing Users
There are two types of ObjectStore users:
You can set OS_ROOTDIR on each host that runs an ObjectStore Server or application. Alternatively, you can set OS_ROOTDIR in each user's environment.
OS_ROOTDIR allows you to change the location of the ObjectStore installation and allows users to switch to a different version of ObjectStore.
You can use the ossetasp utility to change the pathname of an application schema database for a particular executable.
Alternatively, an application can specify its application schema database pathname when it runs by calling objectstore::set_application_schema_path().
| Platform | Local Transport Layer | Remote Network |
|---|---|---|
| Solaris 2 | TLI_LOCAL | TCP/IP |
| Windows | NSharedMemory | TCP/IP |
UNIX
For the local network, ObjectStore uses sockets or TCP/IP streams to communicate among Server, client, and Cache Manager processes using predefined ports that you can modify if necessary. A port identifies a particular application on that machine. (An address identifies a particular machine.) Windows
For the local network, ObjectStore uses a proprietary local network based on Named Shared Memory. Server, client, and Cache Manager processes use an identifier instead of port addresses. You can modify this identifier in the ports file. Defaults for Port Settings
For NSharedMemory, the port setting modifies the default port, so you can use the same setting for all services. The defaults are
connect.server_client accept.server_client connrel.server_client connreg.server_client exception.server_client.On the other networks, a port setting replaces the existing port setting, so you must provide unique settings for each port that you modify.
The default port settings are in the following tables.
Modifying Port Settings
To modify settings, you change entries in the file shown in the following table. After you modify the ports file, you must shut down and restart the Server and Cache Manager for the changes to take effect. When the daemons start, they detect the existence of the ports file and use the settings in the ports file.
| Platform | Ports File |
|---|---|
| UNIX | $OS_ROOTDIR/etc/ports |
| Windows | %OS_ROOTDIR%\ETC\PORTS |
Ports File Format
Each line in the ports file specifies the port for a network service. The syntax of a line in the ports file is
net:service:version:port
TCP/IP:server client:1:54432 NSharedMemory:server client:1:new_server UNIX:server client:1:/tmp/.ostore/objectstore_server_comm UNIX:cache manager client:6:/tmp/.ostore/objectstore_client_cache UNIX:cache manager server:6:/tmp/.ostore/objectstore_server_ cacheIf a ports file is not present, ObjectStore uses default settings.
To set up two Servers on the same host, you need to change only the server client ports for one of the Servers. The Cache Manager ports are already different in different major versions of ObjectStore.
All Servers that a client can communicate with must have the same network port number. This means that if you run two Servers on one host, any single client can access one of those Servers but not the other. It also means that if a client accesses Servers on more than one host, you must change the Server port settings on all affected hosts.
This all happens automatically and transparently, so there is no relevant API. However, as with all network connections, you might want to control the network port that is used by the connection. You can use the ports file in the usual way to control the use of network ports. The relevant information follows:
| Name of service | cache manager notification |
|---|---|
| Default IP port number | 51050 |
| Default UNIX local socket file name | /tmp/ostore/objectstore_notification |
How a Client Locates the Server for a Database
How does a client determine the Server to communicate with? The answer depends on whether the database being created or opened is a file database or a rawfs database. When Accessing a File Database
When a client tries to open or create a file database, the client has a pathname for the database. The client looks for the Server on the machine that has the disk on which the database is or will be stored. Normally, this disk is local to the machine with the Server. In other words, the database is Server local.
If there is a locator file, the client checks it to determine the Server to communicate with.
When Accessing a Rawfs Database
When a client tries to open or create a rawfs database, the rawfs host is specified in the pathname of the rawfs database: See Rawfs Databases.
Managing ObjectStore on Multiple Platforms
When you manage a site that runs ObjectStore on a variety of platforms, there are issues to consider that do not exist when you run ObjectStore on a single platform. Using Multiple File Systems
ObjectStore is not dependent on a particular file system. If the usual file system calls (such as open, read, write, close) work on the file, ObjectStore can use them successfully. Translating Pathnames
You might run an ObjectStore application on both PCs and UNIX systems. UNIX uses forward slashes (/) in pathnames; PCs use back slashes (\). How does ObjectStore handle this? Native pathnames
If you are using something like an NFS client to mount the UNIX file system, you use the client's native syntax. For example, on a PC on which drive Q is NFS-mounted on husky:/desktop1, ObjectStore expands the file name Q:\jet\my.db into a reference to /desktop1/jet/my.db on the Server host husky. Server-relative pathnames
If you do not use file mounting, you can use Server-relative pathnames of the form husky:/desktop/jet/my.db. ObjectStore interprets the part of the pathname that follows the colon (:) according to the syntax of the Server host (UNIX in this example). Callback Messages Background
The Cache Manager facilitates concurrent access to data by handling callback messages from the Server to client applications. To understand the way callback messages work, you need to know about ownership and locks. Note
The terms ownership, encached page, and permit all represent the same concept - a client has permission to read or modify the page. Read or write ownership
Read ownership exists when a client has permission to read a particular page. Write ownership exists when a client has permission to modify a particular page.
When a client has ownership, it can place a lock on a page without communicating with the Server.
A client can have read ownership without a read lock if the client read the page previously but is not reading the page in the current transaction. The same is true for write ownership and locks.
The lazy release is an optimization. If no other client needs the page that your client has ownership of, that client need not request ownership from the Server for that page for as long as the client is active.
The Cache Manager is involved in the following situations:
If the client with ownership
API for lock management
Typically, ObjectStore performs lock management. There are, however, API features that allow a client to control whether a client waits for a lock. When an application uses these features, ObjectStore still uses the lazy release.
ClearCase Virtual File System (MVFS)
If your ObjectStore applications reside in a ClearCase virtual file system (MVFS), they may have trouble locating an ObjectStore Server. To overcome this problem, you should set up locator files or use ObjectStore/Single. See Chapter 5, Using Locator Files to Set Up Server-Remote Databases, for more information on using locator files. See Chapter 6, Working with ObjectStore/Single, in Building ObjectStore C++ Applications for more information about ObjectStore/Single.
Troubleshooting
This section provides examples of problems you might encounter. In general, when you receive an error message you should
| UNIX | /tmp/ostore/oss_out |
| Windows | %OS_TMPDIR%\OSSERVER.TXT |
osserver -F -d 5On Windows, in a console window, enter
osserver -con -d 5The Server sends debug printouts to standard output describing its actions. The number after -d is the debug level. The levels available are described in the following paragraphs.
You can confirm that the Server has started successfully by using the ossvrstat command.
If the Server starts successfully and you want to turn on debugging output just before a test run, you can use the ossvrdebug utility with a command such as
ossvrdebug server host name debug level
This command turns on debug output from the named server and ossvrdebug 0 turns it off. The higher the debug level, the more verbose the output and the more Server performance is affected. The levels are
| Level 0 | Turns ossvrdebug off |
| Level 1 | Reports client connect or disconnect |
| Level 2 | Reports messages received |
| Levels 3-8 | Provide expanded message information |
| Level 9 | Provides full message information |
Server Initialization Failed
Following is a message you might receive when you try to start the Server:
Server initialization failed. (orecvery.cc line 2787) Unknown record type 127528668 at line 1266304 Failed to start ObjectStore serverThe resource affected is the Server and the reference to record type might indicate a problem with the log. To obtain more information, you can
While running a client application you might receive this message:
Mon Jan 25 15:01:12 1999 DEBUG 48416 [03] client #41 (flurry.odi.com/9325/(unknown)): upgrade_locks2 CLIENT MESSAGE 315 RECEIVED Mon Jan 25 15:01:12 1999 DEBUG 48417 [04] client #41 (flurry.odi.com/9325/(unknown)): upgrade_locks2(able to abort, wait forever for lock) Mon Jan 25 15:01:12 1999 DEBUG 48418 [05] client #41 (flurry.odi.com/9325/(unknown)): upgrade_locks2 implicit start_transaction(read/write) Mon Jan 25 15:01:12 1999 DEBUG 48419 [05] client #41 (flurry.odi.com/9325/(unknown)): upgrade_locks2 write_locking(DB handle 28, segment #42, 0, 16)
Mon Jan 25 15:01:12 1999 DEBUG 48420 [05] Callback Thread (flurry.odi.com) client #36: callback for write(pid=9175, DB handle 28, segment #42, 0, 16) Mon Jan 25 15:01:12 1999 DEBUG 48421 [04] Callback Thread (flurry.odi.com) client #36: callback for write(pid=9175, DB handle 28, segment #42, 0, 16) -> POSITIVE
Mon Jan 25 15:01:12 1999 DEBUG 48422 [05] Callback Thread (flurry.odi.com) client #39: callback for write(pid=9318, DB handle 28, segment #42, 0, 16) Mon Jan 25 15:01:12 1999 DEBUG 48423 [04] Callback Thread (flurry.odi.com) client #39: callback for write(pid=9318, DB handle 28, segment #42, 0, 16) -> NEGATIVE
| UNIX | /tmp/oscm_out |
| Windows | %OS_TMPDIR%\OSCMGR6.TXT |
oscmgr6 0 <debug level>On Windows, in a console window, enter
oscmgr6 -con 0 <debug level>The cache manager sends debug printouts that describe its actions to standard output. The number after -d is the debug level described in the following information.
| 1 | Basic information |
| 10 | Client and Server connection information |
| 50 | All information |
You can confirm that the cache manager has started successfully by using the oscmstat command.
Debugging Cache Manager Autostart
When an ObjectStore client is started, the application checks to see whether the cache manager is running. If the cache manager is not running, the client starts it. This process is called the cache manager autostart. If this process fails, you might see a message such as the following:
Miscellaneous ObjectStore error Reached end-of-file reading initial message from cache manager (PID=0) (err_misc) Segmentation FaultThe resource affected is the Cache Manager. To obtain more information you can
| UNIX | /tmp/ostore/osc6_out |
| Windows | OSCMGR6.TXT |
Debugging ObjectStore Client Applications
The following environment variables apply only to client applications.
No Handler for Exception
ObjectStore reports errors by signaling TIX exceptions. If an unexpected error occurs, it is likely that your program does not have a handler for that exception, and your program will exit with the message No handler for exception followed by information on the particular error condition that was signaled. Examples of these kinds of errors appear in the paragraphs that follow. Database Error
While trying to access a database you might receive this message:
No handler for exception: ObjectStore internal error Database dbname has fraction length? (err_internal)The resource affected is the database or the client application. To obtain more information you can
No handler for exception: Cannot open the application schema <err-0025-0311> The application schema database db.asdb was not found (err_cannot_open_application_schema) While trying to open the application schema database.The resource affected is the database. To obtain more information you can
The application schema database must be local to a Server. The only exception to this is when you use a locator file. See Chapter 5, Using Locator Files to Set Up Server-Remote Databases.
Invalid Address
When trying to run a client application you might receive a message such as the following:
No handler for exception ObjectStore internal error ObjectStore referenced invalid address 0x7fff0028(0)The resource affected is the client application. To obtain more information you can
Attempt to use unsupported server protocol. <err-0001-0006> Server elvis does not support version 5.0 clients. (err_protocol_not_supported)ObjectStore displays this message when a Release 6 client tries to communicate with a non-Release 6 Server. This error might occur if you did not shut down the non-Release 6 Server while you installed the Release 6 Server. Shutting down and restarting the non-Release 6 Server should correct the situation.
The exception occurs only when a two-phase commit has problems. A two-phase commit usually occurs only if multiple Servers are being written to in that transaction. If a client reads from ServerA in one transaction and writes to ServerB in the same transaction, it is not a two-phase commit and it is not necessary for ServerA and ServerB to be able to communicate across a common network.
Updated: 03/11/99 11:18:14