Skip site navigation (1) Skip section navigation (2)

Re: libpq++ in Apache Problem.

From: <pgsql-interfaces(at)commandprompt(dot)com>
To: <pgsql-interfaces(at)postgresql(dot)org>
Subject: Re: libpq++ in Apache Problem.
Date: 2001-05-29 14:42:46
Message-ID: Pine.LNX.4.30.0105290742210.6036-100000@commandprompt.com (view raw or flat)
Thread:
Lists: pgsql-interfaces
On Tue, 29 May 2001, jtv wrote:
>On Mon, May 28, 2001 at 10:25:31AM -0700, pgsql-interfaces(at)commandprompt(dot)com wrote:
>>What is perplexing is why the destructor doesn't seem to be doing its job
>>when called from inside httpd, inexplicably. It is definitely reaching
>>that point in the code, but it just doesn't disconnect.
>Well, that's me stumped.  The only other thing I can think of is that some
>query/command execution code forgets to clear up its result set structure
>pointer prior to replacing it with a new result set, thereby confusing the
>underlying C library with invalid pointers.  Or something.

I thought that might be the case too, so I commented out all the code that
actually uses the PgDatabase *sqlDB variable, and it still happens. You
can imagine how frustrating this would be. ;)

I essentially have a block of code that creates a connection, does nothing
with it, SHOULD delete it when it hits the destructor, but either doesn't
destruct at all, or doesn't properly call CloseConnection, or something
more primitive goes wrong. At any rate, the connection, even unused, WILL
NOT GO AWAY! It's mind-boggling.

>>Guess what? It still keeps the connection after leaving its scope. Grr.
>How long-lived are these connections?  I've been seeing my problems after
>leaving them idle for perhaps several seconds.  Shortening their lifetimes
>happened to help in my case <shudder>.

Weird! Well, in my case, I'm just creating an open connection, and it just
hangs out indefinitely. I let it run a full day once just to check. They
hung around for a day or so before I re-started apache to clean up the
processes.

The next step in trouble-shooting this I suppose is to build the dummy
Apache module with libpq++ and see if it the same behavior is exhibited.
If not, it's got to be something deeper in the core of my module.

I'm not sure I like either outcome of that test.


Jw.
--
John Worsley at Command Prompt, Inc.
jlx(at)commandprompt(dot)com by way of pgsql-interfaces(at)commandprompt(dot)com


Responses

pgsql-interfaces by date

Next:From: Joel BurtonDate: 2001-05-29 15:52:35
Subject: Re: gar ...weird odbc thing
Previous:From: Ricardo MaiaDate: 2001-05-29 14:09:09
Subject: Using BLOBs with several DBMS

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group