Help for this page

Select Code to Download


  1. or download this
     if ($self->{_can_do_transactions}) {
         local $dbh->{AutoCommit} = 0;
    ...
     {
         code_that_touches_db();
     }
    
  2. or download this
     if ($self->{_can_do_transactions}) {
    
    ...
     {
         code_that_touches_db();
     }
    
  3. or download this
     eval {
         local $dbh->{AutoCommit} = 0;
     };
     $self->{_can_do_transactions} = $@ ? 0 : 1;
    
  4. or download this
        # If RaiseError is false, begin_work() will:
        #     return true if a new transaction was started
    ...
        };
        $self->{_can_do_transactions} = $@ ? 0 : 1;
        eval { $dbh->rollback } if $started_a_new_transaction;
    
  5. or download this
     closing dbh with active statement handles during global destruction
    
  6. or download this
     eval {
         my $val = $dbh->{AutoCommit};   # makes error go away?
         local $dbh->{AutoCommit} = 0;
     };
     $self->{_can_do_transactions} = $@ ? 0 : 1;