OSF DCE Application Development Guide--Core Components
The DCE Backing Store
dce_db_open( ).
dce_db_delete_by_name()
This routine deletes an item only from a backing store that is indexed by
name.
dce_db_delete_by_uuid( )
This routine deletes an item only from a backing store that is indexed by
UUID.
To delete an entire backing store, ensure that the data file is not open, and remove it.
There is only one file.
5.6.8 Locking and Unlocking a Backing Store
The dce_db_lock( ) and dce_db_unlock( ) routines lock and unlock a backing store. If a
backing store is already locked, dce_db_lock() provides an indication. A lock is
associated with an open backing store’s handle. The storage routines, dce_db_store(),
dce_db_store_by_name(), and dce_db_store_by_uuid( ), all acquire the lock before
updating. Explicit use of locking is appropriate in some circumstances; for example,
when reading or writing pairs (or multiples) of closely associated items in a backing
store, or when using iteration.
The locks are advisory. It is possible to write a backing store even if it is locked so, if
you want to rely upon the locks, you must always check them.
5.7 Example of Backing Store Use
For a full example of backing store use, see the .
The following brief example shows a portion of a server that manages an office
telephone directory. Following are the relevant structures, defined in an IDL file:
typedef struct phone_record_s_t {
[string,ptr] char *name;
[string,ptr] char *email;
[string,ptr] char *phone;
[string,ptr] char *office;
} phone_record_t;
typedef struct phone_record_array_s_t {
unsigned32 count;
[ptr,size_is(count)] phone_record_t *entry;
} phone_record_array_t;
typedef struct phone_data_s_t {
dce_db_header_t h;
124245 Tandem Computers Incorporated 5−9