Index: openacs-4/packages/acs-tcl/tcl/00-database-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/Attic/00-database-procs.tcl,v
diff -u -r1.114 -r1.115
--- openacs-4/packages/acs-tcl/tcl/00-database-procs.tcl	17 Dec 2018 20:17:03 -0000	1.114
+++ openacs-4/packages/acs-tcl/tcl/00-database-procs.tcl	17 Dec 2018 20:46:44 -0000	1.115
@@ -573,7 +573,7 @@
         #
         set pools [db_available_pools $dbn]
         set currentHandles [ns_db currenthandles]
-        ns_log notice "### pools <$pools> currentHandles <$currentHandles>"
+        #ns_log notice "### pools <$pools> currentHandles <$currentHandles>"
 
         set db ""
         set n 0
@@ -612,12 +612,16 @@
             # We were not successful above
             #
             set pool [lindex $pools $n]
+            if {$pool eq ""} {
+                ad_log error "handles from all pools <$pools> are exhausted"
+                error "could not obtain handle, all pools are exhausted"
+            }
             set start_time [expr {[clock clicks -microseconds]/1000.0}]
             #ns_log notice "### BEFORE gethandle $pool ($n)"
             set errno [catch {
                 set db [ns_db gethandle $pool]
             } error]
-            #ns_log notice "### AFTER gethandle $pool errno $errno handle <$db>"
+            ad_log notice "### AFTER gethandle $pool errno $errno handle <$db> currentHandles [ns_db currenthandles]"
             ds_collect_db_call $db gethandle "" $pool $start_time $errno $error
             if { $errno } {
                 ns_log notice "### RETURNING error $error"