PreviousNext

Accessing the DUA Cache Without a GDS Server Present

An application program may need to access the local DUA cache without binding to a GDS server. This topic describes the steps that should be included in the application program. Refer to XOM Programming and XDS Programming for information on how to use the XDS and XOM API calls ds_initialize( ), ds_version( ), ds_bind( ), ds_shutdown( ), om_create( ), om_remove( ), how to do static initialization of public objects, and how to create private objects.

The steps are as follows:

1. Call ds_initialize( ) as normal.

2. Negotiate the DSX_GDS_PKG by using ds_version( ). This is necessary because a DSX_C_GDS_CONTEXT is required in order to set the DUA cache service controls.

3. Supply a DSX_C_GDS_SESSION object to the ds_bind( ) call, which has no DS_DSA_NAME attribute and no DS_DSA_ADDRESS attribute present.

There are two ways of achieving this:

· Supply a public DSX_C_GDS_SESSION object (static initialization):

OM_descriptor cache_session[] = {

OM_OID_DESC(OM_CLASS, DSX_C_GDS_SESSION),

OM_NULL_DESCRIPTOR

};

The other attributes of DSX_C_GDS_SESSION (DS_REQUESTOR, DSX_PASSWORD, DSX_DIR_ID, DSX_AUTH_MECHANISM and DSX_AUTH_INFO) can be included if required.

· Supply a private DSX_C_GDS_SESSION object (using XOM API function calls):

om_create(DSX_C_GDS_SESSION, OM_TRUE, workspace, &cache_session);

om_remove(cache_session, DS_DSA_NAME, 0, OM_ALL_VALUES);

om_remove(cache_session, DS_DSA_ADDRESS, 0, OM_ALL_VALUES);

Note that an uninitialized session object may not be passed to ds_bind( ). That means that OM_FALSE should not be used with the previous om_create( ) function call.

4. Supply a DSX_C_GDS_CONTEXT object to the XDS calls that access the DUA cache. The following service controls must be set to ensure that access is restricted to the DUA cache alone:

DSX_DUA_CACHE = OM_TRUE

DSX_USEDSA = OM_FALSE

(Service controls that access the DSA will result in a DS_E_BAD_CONTEXT error.)

There are two ways of achieving this:

· Supply a public DSX_C_GDS_CONTEXT object (static initialization)

· Supply a private DSX_C_GDS_CONTEXT object (using XOM API function calls)

5. Supply the bound DSX_C_GDS_SESSION object to the ds_unbind( ) call.

6. Call ds_shutdown( ) as normal.