Changeset 504

Show
Ignore:
Timestamp:
06/25/08 00:00:59 (17 months ago)
Author:
ykerherve
Message:

Fixed an issue in the case of a transaction involving different classes using same drivers.
Each $driver stores the same $dbh returned by DBIRole (in our case) but at the end of
the transaction we forget to remove the stashed copy of $dbh in the lasts drivers processed.
So at the beginning of the next transaction the $dbh choke because of the attributes of
the cached $dbh don't match what we're trying to do.

Another patch is on his way for a more streamlined transaction processing. (waiting reviews)

BugzID: 72971

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/lib/Data/ObjectDriver/Driver/DBI.pm

    r494 r504  
    556556        or Carp::croak("$action called without a stored handle--begin_work?"); 
    557557 
    558     return if $dbh->{AutoCommit}; 
    559  
    560     eval { $dbh->$action() }; 
    561     if ($@) { 
    562         Carp::croak("$action failed for driver $driver: $@"); 
     558    unless ($dbh->{AutoCommit}) { 
     559        eval { $dbh->$action() }; 
     560        if ($@) { 
     561            Carp::croak("$action failed for driver $driver: $@"); 
     562        } 
    563563    } 
    564564    if ($driver->{__delete_dbh_after_txn}) {