Support Requests item #412820, was updated on 2001-03-31 23:11
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=203152&aid=412820&group_id=3152

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Michael Tang Helmeste (glassfish)
>Assigned to: Dossy Shiobara (dossy)
Summary: thread/db problems

Initial Comment:
I made this adp script that opens up a connection to a
DB, but it always runs into the limitation of 1 DB
connection per pool, per thread. I looked all through
the configuration and couldn't find any option to set
max DB connections per thread, and when I tried to
subscribe to the aolserver mailing list, it seemed
lagged out (http://listserv.aol.com/cgi-bin/wa?
SUBED1=aolserver&A=1).

Here is the error message I get, and my configuration
file is attached. Any help would be appreciated,
thanks. :)







[31/Mar/2001:09:54:37][17120.993280][-conn0-] Notice:
dbdrv: opening
database 'postgres:localhost:5432:spheredb'
[31/Mar/2001:09:54:37][17120.993280][-conn0-] Notice:
Opening spheredb on localhost
[31/Mar/2001:09:54:37][17120.993280][-conn0-] Notice:
Ns_PgOpenDb(postgres):  Openned connection to
localhost:5432:spheredb.
[31/Mar/2001:09:54:37][17120.993280][-conn0-] Notice:
dbdrv: opening
database 'postgres:localhost:5432:spheredb'
[31/Mar/2001:09:54:37][17120.993280][-conn0-] Notice:
Opening spheredb on localhost
[31/Mar/2001:09:54:37][17120.993280][-conn0-] Notice:
Ns_PgOpenDb(postgres):  Openned connection to
localhost:5432:spheredb.

<!----- problem ----->
[31/Mar/2001:09:54:37][17120.993280][-conn0-] Error:
dbinit: db handle limit exceeded: thread already owns
1 handle from pool
'pgsql_pool2'
[31/Mar/2001:09:54:37][17120.993280][-conn0-] Error:
could not allocate 1 handle from pool "pgsql_pool2"
<!----- problem ----->

could not allocate 1 handle from pool "pgsql_pool2"
    while executing
"ns_db gethandle -timeout 30 pgsql_pool2"
    invoked from within
"set db2 [ns_db gethandle -timeout 30 pgsql_pool2]..."
    ("for" body line 8)
    invoked from within
"for {set i 0} {$i != $size} {incr i 1} {
               ns_db getrow $db $row
               set title [ns_set get $row title]
               set auid ..."
    ("0" arm line 5)
    invoked from within
.....

----------------------------------------------------------------------

>Comment By: Dossy Shiobara (dossy)
Date: 2001-05-30 09:58

Message:
Logged In: YES
user_id=21885

When you want to request more than one handle from a pool,
you have to request them all at the same time, according to
the API docs for ns_db.  Here's the relevant excerpt:

[from http://aolserver.com/docs/tcldev/tapi-c44.htm#67537]

  You must request all the handles you will need for a
  specific pool with one call to ns_db gethandle.  You
  must release all your database handles explicitly (with
  ns_db releasehandle) before acquiring more. If you
  request multiple handles from the database, this
  function returns a Tcl list of database handles (space
  delimited). In this case, each handle must be released
  with a separate call to ns_db releasehandle.

Hope this helps.  Please let me know if I can close this
ticket. -- Dossy

----------------------------------------------------------------------

You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=203152&aid=412820&group_id=3152

Reply via email to