From: janw Date: Thu, 12 Mar 2009 11:14:21 +0000 (+0000) Subject: sqlite crashes on schema changes if using prepare_cached. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=617b03efc7e4ee484ad4b4faa7862b1f46f17d0f;p=gosa.git sqlite crashes on schema changes if using prepare_cached. git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@13537 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/trunk/gosa-si/modules/DBsqlite.pm b/trunk/gosa-si/modules/DBsqlite.pm index f4e442e41..c0406c95f 100644 --- a/trunk/gosa-si/modules/DBsqlite.pm +++ b/trunk/gosa-si/modules/DBsqlite.pm @@ -177,7 +177,7 @@ sub add_dbentry { my $success=0; $self->lock(); eval { - my $sth = $self->{dbh}->prepare_cached($sql_statement); + my $sth = $self->{dbh}->prepare($sql_statement); $db_res = $sth->execute(); $sth->finish(); &main::daemon_log("0 DEBUG: Execution of statement '$sql_statement' succeeded!", 7); @@ -191,7 +191,7 @@ sub add_dbentry { } if($success==0) { eval { - my $sth = $self->{dbh}->prepare_cached($sql_statement); + my $sth = $self->{dbh}->prepare($sql_statement); $db_res = $sth->execute(); $sth->finish(); &main::daemon_log("0 DEBUG: Execution of statement '$sql_statement' succeeded!", 7); @@ -206,7 +206,7 @@ sub add_dbentry { } if($success==0) { eval { - my $sth = $self->{dbh}->prepare_cached($sql_statement); + my $sth = $self->{dbh}->prepare($sql_statement); $db_res = $sth->execute(); $sth->finish(); &main::daemon_log("0 DEBUG: Execution of statement '$sql_statement' succeeded!", 7); @@ -362,7 +362,7 @@ sub exec_statement { # Give three chances to the sqlite database # 1st chance eval { - my $sth = $self->{dbh}->prepare_cached($sql_statement); + my $sth = $self->{dbh}->prepare($sql_statement); my $res = $sth->execute(); @db_answer = @{$sth->fetchall_arrayref()}; $sth->finish(); @@ -383,7 +383,7 @@ sub exec_statement { # 2nd chance eval { DBI->trace(2) if($main::verbose >= 7); - my $sth = $self->{dbh}->prepare_cached($sql_statement); + my $sth = $self->{dbh}->prepare($sql_statement); my $res = $sth->execute(); @db_answer = @{$sth->fetchall_arrayref()}; $sth->finish(); @@ -406,7 +406,7 @@ sub exec_statement { # 3rd chance eval { DBI->trace(2) if($main::verbose >= 7); - my $sth = $self->{dbh}->prepare_cached($sql_statement); + my $sth = $self->{dbh}->prepare($sql_statement); my $res = $sth->execute(); @db_answer = @{$sth->fetchall_arrayref()}; $sth->finish();