Re: mod_perl and Apache::DBI - what happens on request termination

Perrin Harkins <[email protected]>
Newsgroups gmane.comp.apache.mod-perl
Message-ID <CAC0_be0DbbuUrsmt8LcdKFPK30t4GY-+SeGYLZC7gP0QyhoXQw@mail.gmail.com>
On Mon, Jun 4, 2012 at 3:43 PM, André Warnier <[email protected]> wrote:
> So, if the response handler (which runs your script/program which runs the
> DBI code) is busy doing something with the database server, but not writing
> anything back to the client, it will happily continue doing that for as long
> as it takes.
>
> When it is done talking to the database server, and starts sending the data
> to the client, then it will get the error and probably crash, unless it is
> prepared for such errors and returns nicely.

After all that, Apache::DBI will issue a rollback on the database
handle IF you initiated the handle with AutoCommit turned off.

For people who don't use Apache::DBI or who start their connections
with AutoCommit on and turn it off for brief sections, I recommend
installing your own cleanup handler that will issue a rollback in case
there's an uncaught exception in your code during a transaction.

- Perrin
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.