perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Perrin Harkins <per...@elem.com>
Subject Re: Apache::DBI and DBD::Pg
Date Mon, 16 Jan 2006 15:07:59 GMT
On Mon, 2006-01-16 at 05:11 +0000, Jeremy Nixon wrote:
> 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.

You keep the handle in a global and then clear it from a cleanup
handler?  That should work, but I've had better luck using pnotes for
this kind of thing, since no explicit clearing is needed.

> 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.

My experience has been that there is no need to explicitly call begin,
at least with MySQL InnoDB tables.  I use the "read committed" isolation
level, and switching from AutoCommit 1 to 0 seems to have the same
effect as issuing a begin.  It is effectively always inside of a
transaction.

If you have a small enough example of code that shows how you manage
your database handles, you're welcome to post it here and I'll take a
look at it.

- Perrin


Mime
View raw message