ffzg/vuFind: get database for each request
authorDobrica Pavlinusic <dpavlin@rot13.org>
Fri, 23 Nov 2018 07:18:45 +0000 (08:18 +0100)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Mon, 25 Mar 2019 14:43:16 +0000 (15:43 +0100)
ffzg/vuFind.pl

index 65d364d..f531ea9 100755 (executable)
@@ -33,14 +33,16 @@ my $sql = qq{
        where biblionumber = ?
 };
 
-my $dbh = C4::Context->dbh;
-my $sth = $dbh->prepare($sql);
 
 if ( my $biblionumber = $query->param('biblionumber') ) {
 
        if ( $hash = $cache->get_from_cache( "vuFind-$biblionumber" ) ) {
                warn "# $biblionumber HIT\n";
        } else {
+
+               my $dbh = C4::Context->dbh;
+               my $sth = $dbh->prepare($sql);
+
                $sth->execute( $biblionumber );
                while ( my $row = $sth->fetchrow_hashref ) {
                        push @$hash, $row;