Code

sqlite crashes on schema changes if using prepare_cached.
authorjanw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 12 Mar 2009 11:14:21 +0000 (11:14 +0000)
committerjanw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 12 Mar 2009 11:14:21 +0000 (11:14 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@13537 594d385d-05f5-0310-b6e9-bd551577e9d8

trunk/gosa-si/modules/DBsqlite.pm

index f4e442e41e6a66ffd795b6d6c42a1ac3a8569310..c0406c95fc38ebf738853712381822b691096cf5 100644 (file)
@@ -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();