Difference between revisions of "Dbgcache()"

From Recital Documentation Wiki
Jump to: navigation, search
 
Line 37: Line 37:
 
int rc; /* Return Code variable */
 
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 */

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);
	}


SEE ALSO

dbfilemode(), dbdcache(), dbicache()