Difference between revisions of "Dbgcache()"
From Recital Documentation Wiki
Yvonnemilne (Talk | contribs) |
Yvonnemilne (Talk | contribs) |
||
(3 intermediate revisions by one user not shown) | |||
Line 34: | Line 34: | ||
<code lang="c"> | <code lang="c"> | ||
#include "dbl.h" | #include "dbl.h" | ||
− | int dbf; | + | int dbf; /* Database file descriptor */ |
− | int rc; | + | int rc; /* Return Code variable */ |
− | rc = dbfilemode(1,0); /* Shared, Write access | + | rc = dbfilemode(1,0); /* Shared, Write access */ |
− | rc = dbdcache(100); /* Database cache of 100 records */ | + | rc = dbdcache(100); /* Database cache of 100 records */ |
− | rc = dbgcache(1); /* Enable Global Caching | + | rc = dbgcache(1); /* Enable Global Caching */ |
if (rc = dbopen("dbctest.dbf", &dbf) != 0) { | if (rc = dbopen("dbctest.dbf", &dbf) != 0) { |
Latest revision as of 10:42, 1 May 2009
PURPOSE
enable the distributed cache manager on OpenVMS systems
SYNOPSIS
#include "dbl.h" int dbcache(mode) <input parameters> int mode; /* ON | OFF toggle, 0 – OFF, 1 – On */ <output parameters> none
RETURN VALUE
This functions returns 0 upon completion.
DESCRIPTION
This functions enables/disables the distributed cache manager on OpenVMS systems. Normally, if a database or index is opened shareable, any database or index caches specified are not active for the shared files. With the distributed cache manager activated, shared database and index caches are handled by the manager which allows separate processes access to the global cache. Note that proper ENQLM quotas for the processes instituting global caching are necessary.
EXAMPLE
The following example enables global caching on a shared database. Note the use of dbfilemode() and dbdcache().
#include "dbl.h" int dbf; /* Database file descriptor */ int rc; /* Return Code variable */ rc = dbfilemode(1,0); /* Shared, Write access */ rc = dbdcache(100); /* Database cache of 100 records */ rc = dbgcache(1); /* Enable Global Caching */ if (rc = dbopen("dbctest.dbf", &dbf) != 0) { fprintf(stderr, "Database Open Failure: %d\n", rc); exit(1); }