On Fri, 2003-07-25 at 14:55, Levon Barker wrote: > If I have a $dbh global variable in a particular module that I 'use'. I know > that Apache::DBI will give a cached connection to the module to use.
There is no need to use a global. Apache::DBI caches it for you. If you put it in a global, then Apache::DBI doesn't get to do its ping. > But what if I do something like $dbh->commit(); > > Is it possible that I am committing data for another session by accident? At the end of each request, Apache::DBI issues a rollback for any uncommitted transactions. That means that the only things that could be committed are things that you did earlier in the current request. And remember, these are not shared between processes, so there's no need to be worried about interference from other requests. - Perrin