cannot allocate a subquery handle

Philip Greenspun's Homepage : Philip Greenspun's Homepage Discussion Forums : 6916 : One Thread
Notify me of new responses
In trying to complete testing for pset3, I ran into the following
error:

could not allocate 1 handle(s) from pool "subquery"
while executing
"ns_db gethandle subquery"
invoked from within
"set db [ns_db gethandle subquery]..."
(procedure "cm_navbar" line 11)
invoked from within
"cm_navbar"
invoked from within
"ns_return 200 text/html "
[ad_header "Section $section_name Template $template_name"]
[ad_context_bar_ws_or_index [list "/$section_name"
$section_name ..."
invoked from within
"if {![exists_and_not_null rest]} {
# know we're in /whatever (general)
set adp_page "
<%
# expects section_name
ns_adp_bind_args section_nam ..."
invoked from within
"if {[regexp {/([A-z]+)/?(.*)} $observed_url_stub match
section_name rest]} {
# we know we're in movies or dining
if {![exists_and_not_null rest]} {
..."
(procedure "cm_serve_section" line 7)
invoked from within
"cm_serve_section"

I think I need to restart Oracle or something to free up the handles,
but I can't. The problem may stem from the inability to call ns_db
releasehandle from within my private tcl scripts (it was complaining
so they had to go, so I could make progress).

PLease let me know if there's any way I can free up a database handle
and prevent this problem in the future.

Thanks,
Ken

-- Ken McCracken, October 29, 1999

Answers

DB pools

The server is trying to keep you from deadlocking. It will refuse to let you wait for a db handle from a pool from which you are currently holding a handle.

You must either pass the db handle into the procedure, or release the handle that you are holding from that pool.

-- Jesse Koontz, October 29, 1999


Moreover, check to make sure you're not grabbing handles from the subquery pool on a main TCL page (grab two handles from main instead if you have to).

-- Richard Li, November 10, 1999