Thanks for the info everyone. Let's see if it sunk in.

What I've gathered is that since persistent connections are per child apache process, any such problem that might arise would be due to the same child not cleaning its dbhandle attributes up between calls. Normally this would be done at the end of the script by DBI::, but under mod_perl this does not occur. Apache::DBI does do this cleanup before returning the dbhandle on each call (via a rollback unless AutoCommit is on, and possibly a separate cleanup for the "other parameters" regardless). So it seems the short answer is: use Apache::DBI if using DBI with mod_perl? I'm not familiar with Apache::DBI, I thought that the connection would persist under mod_perl simply because the handle isn't destroyed until the child dies.

Perrin- I would test this myself... except that, crazy as it sounds, I'm not currently using mod_perl. I'm developing on a shared host under CGI and preparing for the day I have the time and cash to repair my home dev server. Just trying to code as-if without a good way to test it myself. That's a big part of the reason I appreciate having this list to turn to!

RJ

Perrin Harkins wrote:

RJ Herrick wrote:

Am I correct in thinking that I need to clean up attributes like {mysql_insertid}if I want to ensure that they are specific to my current call?


You do want to clear some things, like locks or AutoCommit settings, at the end of a request if you're fiddling with them. I don't think this is true for mysql_insertid though. I suspect it will just get cleared when the insert fails.

This should be easy to test.  Care to try it, and report back to us?

- Perrin


Reply via email to