Ignore:
Timestamp:
2011-09-27T12:52:59+13:00 (13 years ago)
Author:
jmt12
Message:

Added switch and code for enabling WAL when accessing SQLite, but it didn't seem to have the desired affect

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gs2-extensions/parallel-building/trunk/src/perllib/dbutil/sqlite.pm

    r24626 r24673  
    3737my $db_fast = 0;
    3838
     39# Set to 1 to enable Write Ahead Logging - which is supposed to allow multiple
     40# readers/writers on a SQLite database (overridden by db_fast).
     41my $db_wal = 0;
     42
    3943
    4044# -----------------------------------------------------------------------------
     
    6266  # the nul device instead.
    6367  my $nul_device="";
    64   if(defined $db_fast && $db_fast == 1) {
     68  if($db_fast || $db_wal) {
    6569    if($ENV{'GSDLOS'} =~ m/windows/) {
    6670        $nul_device=">NUL";
     
    8589    print $infodb_handle "PRAGMA journal_mode=MEMORY;\n";
    8690  }
    87  
     91  # Allow parallel readers/writers by using a Write Ahead Logger
     92  elsif ($db_wal)
     93  {
     94    print $infodb_handle "PRAGMA journal_mode=WAL;\n";
     95  }
     96
    8897  # This is very important for efficiency, otherwise each command will be actioned one at a time
    8998  print $infodb_handle "BEGIN TRANSACTION;\n";
Note: See TracChangeset for help on using the changeset viewer.