Update of /cvsroot/popfile/engine/POPFile
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3450/POPFile
Modified Files:
History.pm
Log Message:
Merge the most of my changes on branch b0_22_2.
Index: History.pm
===================================================================
RCS file: /cvsroot/popfile/engine/POPFile/History.pm,v
retrieving revision 1.41
retrieving revision 1.42
diff -C2 -d -r1.41 -r1.42
*** History.pm 6 Mar 2006 12:51:36 -0000 1.41
--- History.pm 26 Nov 2007 15:22:48 -0000 1.42
***************
*** 246,249 ****
--- 246,252 ----
$self->log_( 2, "reserve_slot selected random number $r" );
+ # Avoid another POPFile process using the same committed id
+ $self->db__()->begin_work;
+
# TODO Replace the hardcoded user ID 1 with the looked up
# user ID from the session key
***************
*** 253,256 ****
--- 256,260 ----
if ( defined( $test ) ) {
+ $self->db__()->commit;
next;
}
***************
*** 268,271 ****
--- 272,276 ----
my $result = $self->db_()->selectrow_arrayref(
"select id from history where committed = $r limit 1;");
+ $self->db__()->commit;
my $slot = $result->[0];
***************
*** 458,461 ****
--- 463,467 ----
}
+ $self->db__()->begin_work;
foreach my $entry (@{$self->{commit_list__}}) {
my ( $session, $slot, $bucket, $magnet ) = @{$entry};
***************
*** 605,608 ****
--- 611,615 ----
}
}
+ $self->db__()->commit;
$self->{commit_list__} = ();
***************
*** 687,690 ****
--- 694,698 ----
$self->database_()->tweak_sqlite( 1, 1, $self->db_() );
+ $self->db__()->begin_work;
}
***************
*** 701,704 ****
--- 709,713 ----
my ( $self ) = @_;
+ $self->db__()->commit;
$self->database_()->tweak_sqlite( 1, 0, $self->db_() );
}
|