Changeset 514

Show
Ignore:
Timestamp:
12/16/09 22:14:06 (2 years ago)
Author:
dom
Message:

Remove opportunistic ending of transaction in check_and_write_node, don't twiddle $dbh->{AutoCommit?} but instead use $dbh->begin_work (fixes #49)

Location:
wiki-toolkit/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • wiki-toolkit/trunk/Changes

    r503 r514  
    22        Fix various POD errors and add POD testing (#45) 
    33        More recent changes tests (for #41) 
     4        Fix transaction handling in SQLite backend (#49) 
    45 
    560.77    24 December 2008 
  • wiki-toolkit/trunk/lib/Wiki/Toolkit/Store/SQLite.pm

    r477 r514  
    6767 
    6868    my $dbh = $self->{_dbh}; 
    69     $dbh->{AutoCommit} = 0; 
     69    $dbh->begin_work; 
    7070 
    7171    my $ok = eval { 
    72         $dbh->do("END TRANSACTION"); 
    73         $dbh->do("BEGIN TRANSACTION"); 
    7472        $self->verify_checksum($node, $checksum) or return 0; 
    7573        $self->write_node_post_locking( %args ); 
     
    7876        my $error = $@; 
    7977        $dbh->rollback; 
    80         $dbh->{AutoCommit} = 1; 
    8178        if ( $error =~ /database is locked/ 
    8279            or $error =~ /DBI connect.+failed/ ) { 
     
    8784    } else { 
    8885        $dbh->commit; 
    89         $dbh->{AutoCommit} = 1; 
    9086        return $ok; 
    9187    }