Managing the Thin Client Cache

The client maintains a cache of object lists returned by doOperation() during the current session. doOperation() does not interact with a Server and instead returns a cached list if

You can manage the contents of the cache with ostc_Session::flushObjects().

Component Server API Overview

To create a Component Server plug-in, you must implement the following global functions:

Function When Called by Server Called Within an ObjectStore Transaction? Task
ostcInitialize() When the Server starts No Application-specific initialization
ostcConnect() After ostcInitialize(), when the Server starts No Adding Operations to a Server Session
ostcDisconnect() When the Server shuts down No Application-specific cleanup

In addition, you must derive a type from ostc_ServerOperation for each operation you want the Server to handle. Each derived type must implement the following member functions:

Function When Called by Server Called Within an ObjectStore Transaction? Task
constructor Called by ostcConnect() No Specifying Server Operation Name, Transaction Type, and Formal Parameters
execute() Whenever a thin client calls doOperation() Yes Implementing Server Operation Execution
format() After execute() completes, called once for each return value Yes, same transaction as execute() (except with incremental results) Converting operation results into ostc_Objects

Your implementations of these functions (except ostcConnect() and ostcInitialize()) must be reentrant. That is, you are responsible for synchronizing access to any transient state that could be shared across Server threads. In addition, for operations that use shared_update transactions, you must synchronize access to persistent data if that is necessary to prevent interference among threads.

ostcConnect() and ostcInitialize() are called only when the Server is running a single thread, so they do not require synchronization.

Component Server programs must include the header file <ostcsrvr.h>.



[previous] [next]