13 package Dying::Storage;
18 use base 'DBIx::Class::Storage::DBI';
22 my $death = $self->_dbi_connect_info->[3]{die};
24 die "storage test died: $death" if $death eq 'before_populate';
25 my $ret = $self->next::method (@_);
26 die "storage test died: $death" if $death eq 'after_populate';
33 local $TODO = "I have no idea what is going on here... but it ain't right";
35 for (qw/before_populate after_populate/) {
38 my $schema = DBICTest::Schema->clone;
39 $schema->storage_type ('Dying::Storage');
40 $schema->connection (DBICTest->_database, { die => $_ });
41 $schema->storage->ensure_connected;
42 }, "$_ exception found");
50 For reference - next::method goes to ::Storage::DBI::_populate_dbh
56 my @info = @{$self->_dbi_connect_info || []};
57 $self->_dbh(undef); # in case ->connected failed we might get sent here
58 $self->_dbh($self->_connect(@info));
61 $self->_conn_tid(threads->tid) if $INC{'threads.pm'};
63 $self->_determine_driver;
65 # Always set the transaction depth on connect, since
66 # there is no transaction in progress by definition
67 $self->{transaction_depth} = $self->_dbh_autocommit ? 0 : 1;
69 $self->_run_connection_actions unless $self->{_in_determine_driver};
72 After further tracing it seems that if I die() before $self->_conn_pid($$)
73 the exception is propagated. If I die after it - it's lost. What The Fuck?!