apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Kew <n...@webthing.com>
Subject Re: apr_dbd: a generic SQL wrapper
Date Thu, 09 Dec 2004 19:33:51 GMT
On Thu, 9 Dec 2004, Garrett Rooney wrote:

> This really seems kind of odd, and I'm wondering if it's just because of
> my Subversion background.  So the cleanup that closes the connection is
> registered with the first pool, but the dbd is actually allocated out of
> the second?

No, the second is for temporary stuff.  The mysql driver uses it
to parse the params string into strings that can be passed to
mysql_real_connect.  There's an assumption in there that the
driver itself won't be allocating anything long-lasting on a pool.

Stems from my original implementation in a couple of modules, that
performed an open (== acquire from an apr_reslist) on the server
pool.  But using the server pool in ap_log_error() is effectively
a leak, so I pass it r->pool for that.

> If the first pool is only used to set up a cleanup (maybe, if it's not
> NULL) then perhaps it shouldn't be part of this interface at all.  If
> the caller wants a cleanup run when a specific pool is destroyed the
> caller can set it up themselves.  Special casing the API for it just
> seems wrong.

That seems a valid point.  Guess I may have been trying to be too
clever, or something.  It all ties in to remnants from the architecture
of an apache module with server-lifetime and request-lifetime things.

-- 
Nick Kew

Mime
View raw message