X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FStorage.pm;h=fc87ceb05c2dfa7d6ec2d61e6a1b6056b398b3b0;hb=0dd1b7362ff4b104d68946ae6ca8e7e483621381;hp=9b7dbd9b6095339537d541cc0dea4c9c9d1a3a19;hpb=84efb6d7f74f92330bf03e923a5386bbf5e7cf7e;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Storage.pm b/lib/DBIx/Class/Storage.pm index 9b7dbd9..fc87ceb 100644 --- a/lib/DBIx/Class/Storage.pm +++ b/lib/DBIx/Class/Storage.pm @@ -250,8 +250,19 @@ sub txn_rollback { if ($self->transaction_depth == 1) { $self->debugobj->txn_rollback() if $self->debug; - $self->_exec_txn_rollback; $self->{transaction_depth}--; + + # in case things get really hairy - just disconnect + eval { $self->_exec_txn_rollback; 1 } or do { + my $rollback_error = $@; + + # whatever happens, too low down the stack to care + # FIXME - revisit if stackable exceptions become a thing + eval { $self->disconnect }; + + die $rollback_error; + }; + $self->savepoints([]); } elsif ($self->transaction_depth > 1) { @@ -281,7 +292,7 @@ sub __delicate_rollback { my $self = shift; if ( - $self->transaction_depth > 1 + ( $self->transaction_depth || 0 ) > 1 and # FIXME - the autosvp check here shouldn't be happening, it should be a role-ish thing # The entire concept needs to be rethought with the storage layer... or something @@ -561,7 +572,10 @@ sub debugobj { my @pp_args; if ($profile =~ /^\.?\//) { - require Config::Any; + + if ( my $missing = DBIx::Class::Optional::Dependencies->req_missing_for ('config_file_reader') ) { + $self->throw_exception("Unable to parse TRACE_PROFILE config file '$profile' without $missing"); + } my $cfg = try { Config::Any->load_files({ files => [$profile], use_ext => 1 });