--- loncom/interface/lonsearchcat.pm 2002/11/22 18:36:07 1.161 +++ loncom/interface/lonsearchcat.pm 2003/02/03 04:02:17 1.164 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Search Catalog # -# $Id: lonsearchcat.pm,v 1.161 2002/11/22 18:36:07 matthew Exp $ +# $Id: lonsearchcat.pm,v 1.164 2003/02/03 04:02:17 harris41 Exp $ # # Copyright Michigan State University Board of Trustees # @@ -79,7 +79,6 @@ use Apache::lonnet(); use Apache::File(); use CGI qw(:standard); use Text::Query; -use DBI; use GDBM_File; use Apache::loncommon(); use Apache::lonmysql(); @@ -2250,8 +2249,7 @@ sub display_results { ## foreach my $row (@Results) { if ($connection->aborted()) { - untie %groupsearch_db if (tied(%groupsearch_db)); - &Apache::lonmysql::disconnect_from_db(); + &cleanup(); return; } my %Fields = %{&parse_row(@$row)}; @@ -2963,6 +2961,16 @@ sub start_fresh_session { 1; +sub cleanup { + if (tied(%groupsearch_db)) { + &Apache::lonnet::logthis('Cleanup searchcat: groupsearch_db'); + unless (untie(%groupsearch_db)) { + &Apache::lonnet::logthis('Failed cleanup searchcat: groupsearch_db'); + } + } + &Apache::lonmysql::disconnect_from_db(); +} + __END__ =pod