Perrin Harkins  <[EMAIL PROTECTED]> wrote:

> If you have some code that is caching $dbh in a global or closure, and
> not calling Apache::DBI->connect() on every request, it can't replace
> that, and neither can DBI->connect_cached().  That defeats the auto-
> reconnect features of both.  I recommend not caching $dbh yourself,
> except maybe in pnotes(), since pnotes() only last until the end of the
> request.

Weird.  I'm not caching across requests; I have a cleanup handler that
calls rollback and disconnect, and then nukes my entire db wrapper from
orbit.  But I had the same trouble as the original poster when I tried
using prepared statements.

On the other hand, I have some funky code going on after trying to deal
with DBI's handling of transactions -- I don't want AutoCommit, but it
seems to be impossible to do "set transaction isolation level serializable"
without it, because DBI won't open a transaction if you send that command,
but won't let you send a "begin" yourself, and effectively won't let you
call ->begin unless AutoCommit is on.  So I do have more caching than I
probably should, in order to keep state.  That's where I'll start looking,
then.

-- 
Jeremy  |  [EMAIL PROTECTED]

Reply via email to