It seems that when a database handle is allocated in an ADP page and not
explicitly released, AOLserver no longer releases it automatically.

Is this true? If so, I can't find any documentation anywhere that would
suggest this is the case.

Here is my situation:

Contents of test.adp:

<head><title>Database Test ADP</title></head>
<h1>Database Test ADP</h1>
Here are the names in the database:
set hndl [ns_db gethandle]
set row [ns_db select $hndl { select fname from test_table }]
while {[ns_db getrow $hndl $row] != 0} {
  ns_puts "<li>[ns_set get $row fname]"

When run the first time, everything shows up in the browser as expected.
The list of first names from the test_table relation is correct.
However, if run again within a few seconds (say, reloaded in the
browser) the Tcl chunk errors out and only the title and explanatory
message are displayed.

The server messages read thus:

[26/Mar/2003:17:40:44][25210.6][-conn:server1::0] Error: dbinit: db handle limit 
exceeded: thread already owns 1 handle from pool 'main'
[26/Mar/2003:17:40:44][25210.6][-conn:server1::0] Error: could not allocate 1 handle 
from pool "main"
could not allocate 1 handle from pool "main"
    while executing
"ns_db gethandle"
    invoked from within chunk: 0 of adp:

After a few minutes have elapsed, the ADP will work properly again.
Also, if I include "ns_db releasehandle $hndl" at the end, everything
works fine.

I can reproduce this problem on AOLserver 4.0 beta 3 under Linux with
PostgreSQL, and AOLserver 4.0 betas 3 and 4 under Solaris with Informix.
AOLserver 3.* does not do this.

Any ideas as to what else I should try?

| paul cannon                                    [EMAIL PROTECTED] |
| database handle collector |

AOLserver -
To Remove yourself from this list:
List information and options:

Reply via email to