sub DESTROY { my $self = shift; if ( $self->{ _error } ) { cluck "There was a problem with the transaction: $self->{ _err_str }"; $self->{ _dbh }->rollback; } else { $self->{ _dbh }->commit; } $self->{ _dbh }->disconnect; }