X-Git-Url: http://git.rot13.org/?p=virtual-ldap;a=blobdiff_plain;f=lib%2FLDAP%2FKoha.pm;h=540d2783fdef3875e183e4e85cf4a8be1ac888e2;hp=b0c726c6b815618f99a87d4dc40ce568f42f5bf7;hb=455a72f2613cd8b182b03972cdd1160a40198dc6;hpb=48aedc539d134c25f356305bca51696de826dd76 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 );