- Timestamp:
- 2013-05-06T14:18:28+12:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/dbutil/sqlite.pm
r24190 r27298 37 37 my $db_fast = 0; 38 38 39 # Set to 1 to enable Write Ahead Logging - which is supposed to allow multiple 40 # readers/writers on a SQLite database (incompatible with db_fast). From SQLite 41 # 3.7 onwards, WAL offers limited parallel reader/writer support but is limited 42 # to single computers (doesn't work over networked filesystems). For details 43 # see: http://www.sqlite.org/draft/wal.html [jmt12] 44 my $db_wal = 0; 39 45 40 46 # ----------------------------------------------------------------------------- … … 60 66 # to the web page first, as part of the web page's headers, thus ruining the web page 61 67 # which causes an Internal Server Error (500). Therefore, we redirect sqlite's output to 62 # the nul device instead. 68 # the nul device instead. 69 # using WAL mode (which also changes the journal) suffers a similar issue [jmt12] 63 70 my $nul_device=""; 64 if( defined $db_fast && $db_fast== 1) {71 if($db_fast == 1 || $db_wal == 1) { 65 72 if($ENV{'GSDLOS'} =~ m/windows/) { 66 73 $nul_device=">NUL"; … … 85 92 print $infodb_handle "PRAGMA journal_mode=MEMORY;\n"; 86 93 } 87 94 # Allow parallel readers/writers by using a Write Ahead Logger 95 elsif ($db_wal) 96 { 97 print $infodb_handle "PRAGMA journal_mode=WAL;\n"; 98 } 99 88 100 # This is very important for efficiency, otherwise each command will be actioned one at a time 89 101 print $infodb_handle "BEGIN TRANSACTION;\n";
Note:
See TracChangeset
for help on using the changeset viewer.