From 29e4aa01942b9cb6a19da0244a0dbcecb070040c Mon Sep 17 00:00:00 2001
From: danielk1977
Date: Mon, 26 Mar 2007 08:41:12 +0000
Subject: [PATCH] Add some documentation for pragma locking_mode. (CVS 3715)
FossilOrigin-Name: 394b174e59262a84c530ea73c367d8c389a681b5
---
manifest | 12 ++++++------
manifest.uuid | 2 +-
www/pragma.tcl | 37 ++++++++++++++++++++++++++++++++-----
3 files changed, 39 insertions(+), 12 deletions(-)
diff --git a/manifest b/manifest
index cbbb72d28f..792649f6ff 100644
--- a/manifest
+++ b/manifest
@@ -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
diff --git a/manifest.uuid b/manifest.uuid
index 8c521f2a7c..69c2948012 100644
--- a/manifest.uuid
+++ b/manifest.uuid
@@ -1 +1 @@
-899e60707bea0fabab2ff3ac8a3fbb676a539120
\ No newline at end of file
+394b174e59262a84c530ea73c367d8c389a681b5
\ No newline at end of file
diff --git a/www/pragma.tcl b/www/pragma.tcl
index 1116574a7e..6c32eec644 100644
--- a/www/pragma.tcl
+++ b/www/pragma.tcl
@@ -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.
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.
The pragma command is unlikely to be compatible with any other SQL
engine.
The available pragmas fall into four basic categories:
+
+PRAGMA locking_mode;
+
PRAGMA locking_mode = NORMAL | EXCLUSIVE
+ This pragma sets or queries the database connection locking-mode.
+ The locking-mode is either NORMAL or EXCLUSIVE.
+
+
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.
+
+
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.
+
+
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.
+
PRAGMA page_size;