Add some documentation for pragma locking_mode. (CVS 3715)

FossilOrigin-Name: 394b174e59262a84c530ea73c367d8c389a681b5
This commit is contained in:
danielk1977 2007-03-26 08:41:12 +00:00
parent 334cdb63b0
commit 29e4aa0194
3 changed files with 39 additions and 12 deletions

View File

@ -1,5 +1,5 @@
C Some\sfixes\sand\stest\scases\sfor\sexclusive\saccess\smode.\s(CVS\s3714)
D 2007-03-26T08:05:12
C Add\ssome\sdocumentation\sfor\spragma\slocking_mode.\s(CVS\s3715)
D 2007-03-26T08:41:13
F Makefile.in 1fe3d0b46e40fd684e1e61f8e8056cefed16de9f
F Makefile.linux-gcc 2d8574d1ba75f129aba2019f0b959db380a90935
F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
@ -426,7 +426,7 @@ F www/opcode.tcl 5bd68059416b223515a680d410a9f7cb6736485f
F www/optimizer.tcl d6812a10269bd0d7c488987aac0ad5036cace9dc
F www/optimizing.tcl f0b2538988d1bbad16cbfe63ec6e8f48c9eb04e5
F www/optoverview.tcl 815df406a38c9f69b27d37e8f7ede004c6d9f19e
F www/pragma.tcl ae80ad36e47d37025a2928c74aed3e6445ea4801
F www/pragma.tcl 45dc06f5b92834bc835b394ae186719fe921d6e8
F www/quickstart.tcl 8708a4ca83fbf55c66af1782992626f20c3df095
F www/shared.gif 265bae80c5b311c5a86e47662821076ffaf5c6ea
F www/sharedcache.tcl 3ebec81110e606af6fd65a3c4c19562cb173b29c
@ -438,7 +438,7 @@ F www/tclsqlite.tcl bb0d1357328a42b1993d78573e587c6dcbc964b9
F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b
F www/whentouse.tcl 97e2b5cd296f7d8057e11f44427dea8a4c2db513
P f02ba56d5c6bbd57682a6bb57e9f92021dfb066e
R facce77a37515ab346614e3f902fe80a
P 899e60707bea0fabab2ff3ac8a3fbb676a539120
R c95c47b55de39c81a885f5c3b87d8ccb
U danielk1977
Z 8062a8ad8fbd5e30464ba813e66b27fe
Z a34ef51e67b415410cd73312e1288145

View File

@ -1 +1 @@
899e60707bea0fabab2ff3ac8a3fbb676a539120
394b174e59262a84c530ea73c367d8c389a681b5

View File

@ -1,7 +1,7 @@
#
# Run this Tcl script to generate the pragma.html file.
#
set rcsid {$Id: pragma.tcl,v 1.20 2007/02/02 12:33:17 drh Exp $}
set rcsid {$Id: pragma.tcl,v 1.21 2007/03/26 08:41:13 danielk1977 Exp $}
source common.tcl
header {Pragma statements supported by SQLite}
@ -27,21 +27,21 @@ different in the following important respects:
Unknown pragmas are simply ignored. This means if there is a typo in
a pragma statement the library does not inform the user of the fact.
<li>Some pragmas take effect during the SQL compilation stage, not the
execution stage. This means if using the C-language sqlite3_compile(),
execution stage. This means if using the C-language sqlite3_prepare(),
sqlite3_step(), sqlite3_finalize() API (or similar in a wrapper
interface), the pragma may be applied to the library during the
sqlite3_compile() call.
sqlite3_prepare() call.
<li>The pragma command is unlikely to be compatible with any other SQL
engine.
</ul>
<p>The available pragmas fall into four basic categories:</p>
<ul>
<li>Pragmas used to <a href="#schema">query the schema</a> of the current
database.
<li>Pragmas used to <a href="#modify">modify the operation</a> of the
SQLite library in some manner, or to query for the current mode of
operation.
<li>Pragmas used to <a href="#schema">query the schema</a> of the current
database.
<li>Pragmas used to <a href="#version">query or modify the databases two
version values</a>, the schema-version and the user-version.
<li>Pragmas used to <a href="#debug">debug the library</a> and verify that
@ -235,6 +235,33 @@ puts {
effect on databases that already exist.</p>
</li>
<a name="pragma_locking_mode"></a>
<li><p><b>PRAGMA locking_mode;
<br>PRAGMA locking_mode = <i>NORMAL | EXCLUSIVE</i></b></p>
<p>This pragma sets or queries the database connection locking-mode.
The locking-mode is either NORMAL or EXCLUSIVE.
<p>In NORMAL locking-mode (the default), a database connection
unlocks the database file at the conclusion of each read or
write transaction. When the locking-mode is set to EXCLUSIVE, the
database connection never releases file-locks. The first time the
database is read in EXCLUSIVE mode, a shared lock is obtained and
held. The first time the database is written, an exclusive lock is
obtained and held.
<p>Database locks obtained by a connection in EXCLUSIVE mode may be
released either by closing the database connection, or by setting the
locking-mode back to NORMAL using this pragma and then accessing the
database file (for read or write). Simply setting the locking-mode to
NORMAL is not enough, locks not be released until the next time
the database file is accessed.
<p>There are two reasons to set the locking-mode to EXCLUSIVE. One
is if the application actually wants to prevent other processes from
accessing the database file. The other is that a small number of
filesystem operations are saved by optimizations enabled in this
mode. This may be significant in embedded environments.
</li>
<a name="pragma_page_size"></a>
<li><p><b>PRAGMA page_size;