PreviousNext

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.