Updated: 2022/Sep/29

Please read Privacy Policy. It's for your privacy.


SQLITE3_ENABLE_SHARED_CACHE(3)                        Library Functions Manual

NAME
     sqlite3_enable_shared_cache - enable or disable shared pager cache

SYNOPSIS
     #include <sqlite3.h>

     int
     sqlite3_enable_shared_cache(int);

DESCRIPTION
     This routine enables or disables the sharing of the database cache and
     schema data structures between connections to the same database.  Sharing
     is enabled if the argument is true and disabled if the argument is false.

     This interface is omitted if SQLite is compiled with
     -DSQLITE_OMIT_SHARED_CACHE.  The -DSQLITE_OMIT_SHARED_CACHE compile-time
     option is recommended because the use of shared cache mode is
     discouraged.

     Cache sharing is enabled and disabled for an entire process.  This is a
     change as of SQLite version 3.5.0 (dateof:3.5.0).  In prior versions of
     SQLite, sharing was enabled or disabled for each thread separately.

     The cache sharing mode set by this interface effects all subsequent calls
     to sqlite3_open(), sqlite3_open_v2(), and sqlite3_open16().  Existing
     database connections continue to use the sharing mode that was in effect
     at the time they were opened.

     This routine returns SQLITE_OK if shared cache was enabled or disabled
     successfully.  An error code is returned otherwise.

     Shared cache is disabled by default.  It is recommended that it stay that
     way.  In other words, do not use this routine.  This interface continues
     to be provided for historical compatibility, but its use is discouraged.
     Any use of shared cache is discouraged.  If shared cache must be used, it
     is recommended that shared cache only be enabled for individual database
     connections using the sqlite3_open_v2() interface with the
     SQLITE_OPEN_SHAREDCACHE flag.

     Note: This method is disabled on MacOS X 10.7 and iOS version 5.0 and
     will always return SQLITE_MISUSE.  On those systems, shared cache mode
     should be enabled per-database connection via sqlite3_open_v2() with
     SQLITE_OPEN_SHAREDCACHE.

     This interface is threadsafe on processors where writing a 32-bit integer
     is atomic.

IMPLEMENTATION NOTES
     These declarations were extracted from the interface documentation at
     line 6789.

     SQLITE_API int sqlite3_enable_shared_cache(int);

SEE ALSO
     sqlite3(3), sqlite3_open(3), SQLITE_OK(3), SQLITE_OPEN_READONLY(3)

NetBSD 10.99                    August 24, 2023                   NetBSD 10.99