On 5/9/07, Nick Kew <[EMAIL PROTECTED]> wrote:
Aaargh!  Sorry, I meant apr_reslist_invalidate.

In penance, I'm going to try and find a bug report that discusses
the issue.  Aha, I think this is the one:
http://issues.apache.org/bugzilla/show_bug.cgi?id=39329
It was left open for more reports to come in (what variant of the fix
will work best, etc).  But it wants revisiting.

OK, I believe I have fully identified the problem now, and I don't
think that this bug report addresses my issue. My problem specifically
involves the mysql dbd provider (apr_dbd_mysql.c). When I create a
prepared statement with DBDPrepareSQL, that statement is created with
a call to apr_dbd_prepare. The mysql version of apr_dbd_prepare
creates its own connection to the database. It has to do this because
prepared statements are associated with a specific connection and
become invalid if that connection is closed. I can't just grab another
connection with ap_dbd_acquire because the prepared statement wouldn't
be valid for that connection and there's no way for me to change the
connection used by an apr_dbd_prepared_t. The only solution seems to
be to call apr_dbd_prepare to create a new prepared statement followed
by:

apr_hash_set ( dbd->prepared, label, APR_HASH_KEY_STRING, statement);

but this raises potential threading issues, doesn't it?

I'm new to apache development so please forgive me if I've made some
obvious mistake.

Reply via email to