X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FStorage%2FDBI.pm;h=109802fc6a5d87047d9a03710fd514fcf7cea328;hb=8d9ab8aefaa5fac33c8fd72f7fd90cd295305bcb;hp=a91346ce6b17c5adc3c1765b5c17e1ba42adbedc;hpb=e4697499bb4c7e2f697bf2a003a2d5d857d7c03c;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Storage/DBI.pm b/lib/DBIx/Class/Storage/DBI.pm index a91346c..109802f 100644 --- a/lib/DBIx/Class/Storage/DBI.pm +++ b/lib/DBIx/Class/Storage/DBI.pm @@ -441,14 +441,17 @@ sub connect_info { # _connect() never looks past $args[0] in this case %attrs = () } else { - %attrs = (%{ $self->_dbi_connect_attributes }, %attrs); + %attrs = ( + %{ $self->_default_dbi_connect_attributes || {} }, + %attrs, + ); } $self->_dbi_connect_info([@args, keys %attrs ? \%attrs : ()]); $self->_connect_info; } -sub _dbi_connect_attributes { +sub _default_dbi_connect_attributes { return { AutoCommit => 1 }; } @@ -2426,7 +2429,7 @@ sub DESTROY { DBIx::Class can do some wonderful magic with handling exceptions, disconnections, and transactions when you use C<< AutoCommit => 1 >> -combined with C for transaction support. +(the default) combined with C for transaction support. If you set C<< AutoCommit => 0 >> in your connect info, then you are always in an assumed transaction between commits, and you're telling us you'd @@ -2438,7 +2441,6 @@ cases if you choose the C<< AutoCommit => 0 >> path, just as you would be with raw DBI. - =head1 AUTHORS Matt S. Trout