Fossil SCM

Try to start a new write transaction before updating the VCACHE table. This will hopefully prevent occasional "database is locked" errors when browsing the documentation.

drh 2018-08-29 11:04 trunk
Commit 03979823d152afbd0ddd057d050aa5e0a5f5c20e04245b8746588dc26c35e874
1 file changed +4
+4
--- src/doc.c
+++ src/doc.c
@@ -467,10 +467,14 @@
467467
** if the file is not found or could not be loaded.
468468
*/
469469
int doc_load_content(int vid, const char *zName, Blob *pContent){
470470
int writable = db_is_writeable("repository");
471471
int rid; /* The RID of the file being loaded */
472
+ if( writable ){
473
+ db_end_transaction(0);
474
+ db_begin_write();
475
+ }
472476
if( !db_table_exists("repository", "vcache") || !writable ){
473477
db_multi_exec(
474478
"CREATE %s TABLE IF NOT EXISTS vcache(\n"
475479
" vid INTEGER, -- check-in ID\n"
476480
" fname TEXT, -- filename\n"
477481
--- src/doc.c
+++ src/doc.c
@@ -467,10 +467,14 @@
467 ** if the file is not found or could not be loaded.
468 */
469 int doc_load_content(int vid, const char *zName, Blob *pContent){
470 int writable = db_is_writeable("repository");
471 int rid; /* The RID of the file being loaded */
 
 
 
 
472 if( !db_table_exists("repository", "vcache") || !writable ){
473 db_multi_exec(
474 "CREATE %s TABLE IF NOT EXISTS vcache(\n"
475 " vid INTEGER, -- check-in ID\n"
476 " fname TEXT, -- filename\n"
477
--- src/doc.c
+++ src/doc.c
@@ -467,10 +467,14 @@
467 ** if the file is not found or could not be loaded.
468 */
469 int doc_load_content(int vid, const char *zName, Blob *pContent){
470 int writable = db_is_writeable("repository");
471 int rid; /* The RID of the file being loaded */
472 if( writable ){
473 db_end_transaction(0);
474 db_begin_write();
475 }
476 if( !db_table_exists("repository", "vcache") || !writable ){
477 db_multi_exec(
478 "CREATE %s TABLE IF NOT EXISTS vcache(\n"
479 " vid INTEGER, -- check-in ID\n"
480 " fname TEXT, -- filename\n"
481

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button