Changeset 3769

Show
Ignore:
Timestamp:
01/11/08 18:30:38 (12 months ago)
Author:
jmathis
Message:

disconnect threads from Mysql When they sleep

Location:
branches/centreon-1.4.2.4/ODS/lib
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • branches/centreon-1.4.2.4/ODS/lib/getHostData.pm

    r3554 r3769  
    2929    my $data_host = $sth2->fetchrow_hashref(); 
    3030    my $host_id = $data_host->{'host_id'}; 
     31    $sth2->finish(); 
    3132    undef($sth2); 
    3233    undef($data_host); 
  • branches/centreon-1.4.2.4/ODS/lib/getServiceData.pm

    r3585 r3769  
    3030        if (!$sth2->execute) {writeLogFile("Error when getting service id : " . $sth2->errstr . "\n");} 
    3131        my $data = $sth2->fetchrow_hashref(); 
     32        $sth2->finish(); 
    3233        undef($sth2); 
    3334         
     
    5051                $service_id = $data->{'service_id'}; 
    5152                undef($data); 
     53                $sth2->finish(); 
    5254                undef($sth2); 
    5355                return $service_id; 
     
    102104    if (!$sth1->execute){writeLogFile("Error where getting service interval : ".$sth1->errstr."\n");} 
    103105    my $data_metric = $sth1->fetchrow_hashref(); 
     106    $sth1->finish(); 
    104107     
    105108    $sth1 = $con_ods->prepare("SELECT service_id FROM index_data WHERE id = '".$data_metric->{'index_id'}."'"); 
    106109    if (!$sth1->execute) {writeLogFile("Error where getting service interval 2 : ".$sth1->errstr."\n");} 
    107110    my $data_hst_svc = $sth1->fetchrow_hashref(); 
     111    $sth1->finish(); 
    108112        undef($sth1); 
    109113    undef($data_metric); 
     114     
    110115    my $return = getMyServiceField($data_hst_svc->{'service_id'}, "service_normal_check_interval"); 
    111116    undef($data_hst_svc); 
     
    116121    $sth1 = $con_ods->prepare("SELECT service_id FROM index_data WHERE id = '".$_[0]."'"); 
    117122    if (!$sth1->execute) {writeLogFile("Error where getting service interval 2 : ".$sth1->errstr."\n");} 
    118     my $data_hst_svc = $sth1->fetchrow_hashref();        
     123    my $data_hst_svc = $sth1->fetchrow_hashref();  
     124        $sth1->finish(); 
    119125        undef($sth1); 
    120126    undef($data_metric); 
  • branches/centreon-1.4.2.4/ODS/lib/identifyMetric.pm

    r3586 r3769  
    3737        if (!$sth1->execute) {writeLogFile("Error:" . $sth1->errstr . "\n");} 
    3838        my $configuration = $sth1->fetchrow_hashref(); 
     39        $sth1->finish(); 
    3940        undef($sth1); 
    4041         
  • branches/centreon-1.4.2.4/ODS/lib/purge.pm

    r3504 r3769  
    2828                $srv_list{$data->{'host_host_id'} ."_". $data->{'service_service_id'}} = 1; 
    2929        } 
     30        $sth2->finish(); 
    3031        undef($data); 
    3132        undef($sth2); 
     
    4041                } 
    4142        } 
     43        $sth2->finish(); 
     44        $sth3->finish(); 
    4245        undef($data); 
    4346        undef($sth2); 
     
    5962                                        writeLogFile("Error when deleting Data for host ".$data->{'host_id'}." and svc ".$data->{'service_id'}." m : ".$data_svc->{'metric_id'}." :" . $sth2->errstr . "\n"); 
    6063                                } 
     64                                $sth2->finish(); 
    6165                                undef($sth2); 
    6266                                $sth2 = $con_ods->prepare("DELETE FROM metrics WHERE metric_id = '".$data_svc->{'metric_id'}."'");       
     
    6468                                        writeLogFile("Error when deleting Metrics for host ".$data->{'host_id'}." and svc ".$data->{'service_id'}." m : ".$data_svc->{'metric_id'}." : " . $sth2->errstr . "\n"); 
    6569                                } 
     70                                $sth2->finish(); 
    6671                                undef($sth2); 
    6772                                $t++; 
     
    7378                                        writeLogFile("Error when index for host ".$data->{'host_id'}." and svc ".$data->{'service_id'}." :" . $sth2->errstr . "\n"); 
    7479                                } 
     80                                $sth2->finish(); 
    7581                        } 
    7682                        undef($sth2); 
     
    7884                } 
    7985        } 
     86        $sth->finish(); 
     87        $sth2->finish(); 
    8088        undef($sth); 
    8189        undef($sth2);