From: naoki i. <am...@us...> - 2008-02-07 15:50:11
|
Update of /cvsroot/popfile/engine/POPFile In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14434/POPFile Modified Files: History.pm Log Message: Fixed a bug that causes a few warnings during the corpus upgrade process. Index: History.pm =================================================================== RCS file: /cvsroot/popfile/engine/POPFile/History.pm,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** History.pm 1 Dec 2007 22:22:20 -0000 1.44 --- History.pm 7 Feb 2008 15:41:57 -0000 1.45 *************** *** 240,243 **** --- 240,245 ---- my $r; + my $in_transaction = ! ( $self->db__()->{AutoCommit} ); + $self->log_( 2, "already in a transaction." ) if ($in_transaction); while (1) { *************** *** 247,251 **** # Avoid another POPFile process using the same committed id ! $self->db_()->begin_work; # TODO Replace the hardcoded user ID 1 with the looked up --- 249,253 ---- # Avoid another POPFile process using the same committed id ! $self->db_()->begin_work unless ($in_transaction); # TODO Replace the hardcoded user ID 1 with the looked up *************** *** 256,260 **** if ( defined( $test ) ) { ! $self->db_()->commit; next; } --- 258,262 ---- if ( defined( $test ) ) { ! $self->db_()->commit unless ($in_transaction); next; } *************** *** 272,276 **** my $result = $self->db_()->selectrow_arrayref( "select id from history where committed = $r limit 1;"); ! $self->db_()->commit; my $slot = $result->[0]; --- 274,278 ---- my $result = $self->db_()->selectrow_arrayref( "select id from history where committed = $r limit 1;"); ! $self->db_()->commit unless ($in_transaction); my $slot = $result->[0]; |