xref: /netbsd-src/external/public-domain/sqlite/man/sqlite3_enable_shared_cache.3 (revision bdc22b2e01993381dcefeff2bc9b56ca75a4235c)
1.Dd March 11, 2017
2.Dt SQLITE3_ENABLE_SHARED_CACHE 3
3.Os
4.Sh NAME
5.Nm sqlite3_enable_shared_cache
6.Nd Enable Or Disable Shared Pager Cache
7.Sh SYNOPSIS
8.Ft int
9.Fo sqlite3_enable_shared_cache
10.Fa "int"
11.Fc
12.Sh DESCRIPTION
13This routine enables or disables the sharing of the database cache
14and schema data structures between  connections to the
15same database.
16Sharing is enabled if the argument is true and disabled if the argument
17is false.
18.Pp
19Cache sharing is enabled and disabled for an entire process.
20This is a change as of SQLite version 3.5.0 (dateof:3.5.0).
21In prior versions of SQLite, sharing was enabled or disabled for each
22thread separately.
23.Pp
24The cache sharing mode set by this interface effects all subsequent
25calls to sqlite3_open(), sqlite3_open_v2(),
26and sqlite3_open16().
27Existing database connections continue use the sharing mode that was
28in effect at the time they were opened.
29.Pp
30This routine returns SQLITE_OK if shared cache was enabled
31or disabled successfully.
32An error code is returned otherwise.
33.Pp
34Shared cache is disabled by default.
35But this might change in future releases of SQLite.
36Applications that care about shared cache setting should set it explicitly.
37.Pp
38Note: This method is disabled on MacOS X 10.7 and iOS version 5.0 and
39will always return SQLITE_MISUSE.
40On those systems, shared cache mode should be enabled per-database
41connection via sqlite3_open_v2() with SQLITE_OPEN_SHAREDCACHE.
42.Pp
43This interface is threadsafe on processors where writing a 32-bit integer
44is atomic.
45.Pp
46.Sh SEE ALSO
47.Xr sqlite3 3 ,
48.Xr sqlite3_open 3 ,
49.Xr SQLITE_OK 3 ,
50.Xr SQLITE_OPEN_READONLY 3
51