On Thu, Sep 07, 2000 at 11:06:00AM -0700, Perrin Harkins wrote:
> On Thu, 7 Sep 2000, Nicolas MONNET wrote:
> > |Well, Apache::DBI does push a cleanup handler that does a rollback if
> > |auto-commit is off.  Are you saying this isn't working?
> > 
> > I've run into a situation where it was'nt. I wanted to make sure
> > it's not the desired behaviour, before I can dig more into it to look how
> > it's heppening.
> 
> With AutoCommit off, you should definitely get a rollback on every
> request, provided you actually called DBI->connect on that request.  Turn
> on the debug flag ($Apache::DBI::DEBUG = 2) and see if the cleanup handler
> is being run or not.

The code

    my $needCleanup = ($Idx =~ /AutoCommit[^\d]+0/) ? 1 : 0;
    if(!$Rollback{$Idx} and $needCleanup and Apache->can('push_handlers')) {
        print STDERR "$prefix push PerlCleanupHandler \n" if $Apache::DBI::DEBUG > 1;
        Apache->push_handlers("PerlCleanupHandler", \&cleanup);

of Apache::DBI line 90 suggests that if AutoCommit isn't zero upon
_connect_, the cleanup won't even be called. So if you do

        my $dbh = DBI->connect('dbi:Oracle:sid');
        $dbh->{'AutoCommit'} = 0;

such a $dbh won't be rollbacked.

-- 
------------------------------------------------------------------------
 Honza Pazdziora | [EMAIL PROTECTED] | http://www.fi.muni.cz/~adelton/
 .project: Perl, DBI, Oracle, MySQL, auth. WWW servers, MTB, Spain, ...
------------------------------------------------------------------------

Reply via email to