From: janw Date: Mon, 2 Mar 2009 10:45:50 +0000 (+0000) Subject: Applied patch from upstream trunk, changeset:13477 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=9491dc21f78999b9f0819d1688337fb60b7c44e3;p=gosa.git Applied patch from upstream trunk, changeset:13477 git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@13482 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/trunk/gosa-si/modules/DBsqlite.pm b/trunk/gosa-si/modules/DBsqlite.pm index 541dfbb77..0e1da74f6 100644 --- a/trunk/gosa-si/modules/DBsqlite.pm +++ b/trunk/gosa-si/modules/DBsqlite.pm @@ -16,11 +16,6 @@ sub new { my $db_name = shift; my $lock = $db_name.".si.lock"; - # delete existing lock - instance should be running only once - if(stat($lock)) { - &main::daemon_log("DEBUG: Removed existing lock file $lock.", 7); - unlink($lock); - } my $self = {dbh=>undef,db_name=>undef,db_lock=>undef,db_lock_handle=>undef}; my $dbh = DBI->connect("dbi:SQLite:dbname=$db_name", "", "", {RaiseError => 1, AutoCommit => 1}); $self->{dbh} = $dbh; @@ -330,6 +325,7 @@ sub exec_statementlist { foreach my $sql (@$sql_list) { if(defined($sql) && length($sql) > 0) { + # Obtain a new lock for each statement to not block the db for a too long time $self->lock(); eval { my @answer = @{$self->{dbh}->selectall_arrayref($sql)};