X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FStorage%2FDBI.pm;h=a4e39641af2dc6268c0f7369b86e7d07e90b82a2;hb=3eee36aa81bcc92e08856b64a08ea099316b55ff;hp=846deccaaa28663f824c4e011458410a69f7e2d5;hpb=29d0866bdb553edfd2f02840fa24f1606e7ec316;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Storage/DBI.pm b/lib/DBIx/Class/Storage/DBI.pm index 846decc..a4e3964 100644 --- a/lib/DBIx/Class/Storage/DBI.pm +++ b/lib/DBIx/Class/Storage/DBI.pm @@ -493,7 +493,7 @@ sub connect_info { sub _normalize_connect_info { my ($self, $info_arg) = @_; my %info; - + my @args = @$info_arg; # take a shallow copy for further mutilation # combine/pre-parse arguments depending on invocation style @@ -1050,7 +1050,7 @@ sub _connect { eval { if(ref $info[0] eq 'CODE') { - $dbh = &{$info[0]} + $dbh = $info[0]->(); } else { $dbh = DBI->connect(@info); @@ -1172,6 +1172,11 @@ sub _svp_generate_name { sub txn_begin { my $self = shift; + + # this means we have not yet connected and do not know the AC status + # (e.g. coderef $dbh) + $self->ensure_connected if (! defined $self->_dbh_autocommit); + if($self->{transaction_depth} == 0) { $self->debugobj->txn_begin() if $self->debug;