From: pgsql-interfaces@commandprompt.com
To: pgsql-interfaces@postgresql.org
Subject: Re: libpq++ in Apache Problem.
Date: Tue, 29 May 2001 07:42:46 -0700 (PDT)
Message-ID: <Pine.LNX.4.30.0105290742210.6036-100000@commandprompt.com> (raw)
On Tue, 29 May 2001, jtv wrote:
>On Mon, May 28, 2001 at 10:25:31AM -0700, pgsql-interfaces@commandprompt.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@commandprompt.com by way of pgsql-interfaces@commandprompt.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-interfaces@postgresql.org
Cc: pgsql-interfaces@commandprompt.com
Subject: Re: libpq++ in Apache Problem.
In-Reply-To: <Pine.LNX.4.30.0105290742210.6036-100000@commandprompt.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox