summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3fef084)
raw | patch | inline | side by side (parent: 3fef084)
author | janw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 2 Mar 2009 10:45:50 +0000 (10:45 +0000) | ||
committer | janw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 2 Mar 2009 10:45:50 +0000 (10:45 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@13482 594d385d-05f5-0310-b6e9-bd551577e9d8
trunk/gosa-si/modules/DBsqlite.pm | patch | blob | history |
index 541dfbb77105e72af54d90245520d5b8cadc0e3d..0e1da74f6c5ea6b8ad8f4d500ee0e6f28d8b0f19 100644 (file)
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;
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)};