Name

sqlite3_enable_shared_cache() — Enable or disable shared cache mode

Definition

int sqlite3_enable_shared_cache( int enabled );
enabled

An enable/disable flag. A nonzero flag will enable shared cache mode, while a zero value will disable it.

Returns

An SQLite result code.

Description

This function enables or disables shared cache across database connections. By default, shared cache mode is disabled. If enabled, an application that uses multiple database connections to the same database will share page caches and other management data. This can reduce memory usage and I/O, but there are also a number of minor limitations associated with having shared cache mode enabled.

Altering the cache mode will not change any existing database connections. It will only affect the mode used by new database connections created with an sqlite3_open_xxx() function.

For more information on shared cache mode, see http://www.sqlite.org/sharedcache.html.

Get Using SQLite now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.