@@ -, +, @@ --- C4/Context.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) --- a/C4/Context.pm +++ a/C4/Context.pm @@ -689,9 +689,13 @@ sub dbh my $self = shift; my $params = shift; my $sth; + state $dbh; unless ( $params->{new} ) { - return Koha::Database->schema->storage->dbh; + unless ($dbh) { + $dbh = Koha::Database->schema->storage->dbh; + } + return $dbh; } return Koha::Database->schema({ new => 1 })->storage->dbh; --