From bf2e91560c7fdacb4cf32904873706904b9ee1eb Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Tue, 4 Mar 2008 13:25:04 +1300 Subject: [PATCH] IMPORTANT: clean up after Z39.50 connections Signed-off-by: Chris Cormack Signed-off-by: Joshua Ferraro --- C4/Context.pm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/C4/Context.pm b/C4/Context.pm index deb547b3ec..4775351f59 100644 --- a/C4/Context.pm +++ b/C4/Context.pm @@ -498,6 +498,14 @@ sub Zconn { return $context->{"Zconn"}->{$server}; # No connection object or it died. Create one. }else { + # release resources if we're closing a connection and making a new one + # FIXME: this needs to be smarter -- an error due to a malformed query or + # a missing index does not necessarily require us to close the connection + # and make a new one, particularly for a batch job. However, at + # first glance it does not look like there's a way to easily check + # the basic health of a ZOOM::Connection + $context->{"Zconn"}->{$server}->destroy() if defined($context->{"Zconn"}->{$server}); + $context->{"Zconn"}->{$server} = &_new_Zconn($server,$async,$auth,$piggyback,$syntax); return $context->{"Zconn"}->{$server}; } -- 2.39.2