From 455a72f2613cd8b182b03972cdd1160a40198dc6 Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Mon, 19 Apr 2010 13:48:35 +0000 Subject: [PATCH] use connect_cached so we will reconnect when mysql drops connection --- lib/LDAP/Koha.pm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/LDAP/Koha.pm b/lib/LDAP/Koha.pm index b0c726c..540d278 100644 --- a/lib/LDAP/Koha.pm +++ b/lib/LDAP/Koha.pm @@ -39,8 +39,6 @@ $SIG{__DIE__} = sub { require 'config.pl' if -e 'config.pl'; -my $dbh = DBI->connect($dsn . $database, $user,$passwd, { RaiseError => 1, AutoCommit => 1 }) || die $DBI::errstr; - # we need reverse LDAP -> SQL mapping for where clause my $ldap_sql_mapping = { @@ -208,6 +206,7 @@ sub search { ; warn "# SQL:\n$sql\n# DATA: ",dump( @values ); + my $dbh = DBI->connect_cached($dsn . $database, $user,$passwd, { RaiseError => 1, AutoCommit => 1 }) || die $DBI::errstr; my $sth = $dbh->prepare( $sql ); $sth->execute( @values ); -- 2.20.1