Forum OpenACS Q&A: openacs with PG7.1

Posted by Brett Schwarz on
Anyone have openacs working with PG7.1? I installed PG7.1, and now I get the error:
Error: dbinit: db handle limit exceeded: thread already own s 1 handle from pool 'main'

I usually know what this means, but I checked several different pages, and they are only calling ns_db gethandle once, and then releasing.

I then reverted back to PG7.0 (I renamed the pgsql directories), and everything worked fine. Is there something specific with 7.1 that needs changing? I re-compiled the postgres driver as well, but that did not help.

Any ideas?

Posted by Roberto Mello on
Hmmm. I've been running OpenACS with PG 7.1 for over a month, since the betas, with no problems. Are you using the same nsd.tcl? Any specific pages where this error comes up?
Posted by Brett Schwarz on
Ok, this is really weird. I went back to 7.1. I went to some pages that I had done myself (non-openacs pages). They would not render. I was getting the same error as above. I then went to an openacs page (/file-storage/). It rendered fine. I *then* went back to the same pages that were giving me problems, and they work fine now ?!?!?!?

Maybe I am just too tired here...
thanks for the looks like it is working now...

Posted by Jonathan Marsden on
Brett, I haven't seen anything like this here with PG 7.1 either.  So
I suspect it is something 'unique' at your site.  Can you replicate
the problem at will (ie restart aolserver, then if the first page
you go to is page such-and-such, it always generates this error)?

If it's completely 'gone away' for you now and you can't make it come
back, cool, just forget it :-)  But otherwise, see if you can more
narrowly define exactly what it takes to make the error happen.  If
you have a test machine available, can you install a fresh copy of
PG 7.1/AOLserver 3.2+ad12/OpenACS 3.2.5 on it and generate the same
issue there too?

Posted by Brian Mann on
I was doing it to me, too, the page would load just fine, but it would always cause that error. Upgrading to 3.2.5 seems to have fixed it. The code that caused it was:
set db1 [ns_db gethandle]
set selection [ns_db select $db1 "select * from calendar where sysdate() <= end_date order by start_date"]

while {[ns_db getrow $db1 $selection]} {

   set title [ns_set get $selection title]
   set calendar_id [ns_set get $selection calendar_id]
   set approved_p [ns_set get $selection approved_p]
   if {$approved_p != "f"} {
       ns_puts "<li><a href="calendar/item.tcl?calendar_id=$calendar_id">$title</a>"
ns_puts "</ul>"
#ns_puts [calendar_small_month -day_number_template "<a href="threads-one-day.tcl?[export_url_vars topic_id topic]&julian_dat
e=$julian_date"><font size=-1>$day_number</font></a>"]
#ns_puts "[calendar_small_month -day_bgcolor "#00FFFF"]"