From: Matt S Trout Date: Fri, 11 May 2007 03:54:27 +0000 (+0000) Subject: eliminate the last of the AutoCommit warnings X-Git-Tag: v0.08010~150^2~68 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3943fd63c8d430d5075f8f4b7b254e4b16accae2;p=dbsrgits%2FDBIx-Class.git eliminate the last of the AutoCommit warnings --- diff --git a/lib/DBIx/Class/Schema.pm b/lib/DBIx/Class/Schema.pm index 223dbd3..b1fa17f 100644 --- a/lib/DBIx/Class/Schema.pm +++ b/lib/DBIx/Class/Schema.pm @@ -503,7 +503,8 @@ more information. sub compose_connection { my ($self, $target, @info) = @_; - warn "compose_connection deprecated as of 0.08000" unless $warn++; + warn "compose_connection deprecated as of 0.08000" + unless ($INC{"DBIx/Class/CDBICompat.pm"} || $warn++); my $base = 'DBIx::Class::ResultSetProxy'; eval "require ${base};"; diff --git a/lib/DBIx/Class/Storage/DBI.pm b/lib/DBIx/Class/Storage/DBI.pm index 067a47a..33adf88 100644 --- a/lib/DBIx/Class/Storage/DBI.pm +++ b/lib/DBIx/Class/Storage/DBI.pm @@ -486,7 +486,6 @@ sub connect_info { # but not in the coderef case, obviously. if(ref $info->[0] ne 'CODE') { $last_info = $info->[3]; - warn "You *really* should explicitly set AutoCommit " . "(preferably to 1) in your db connect info" if !$last_info diff --git a/t/lib/DBICTest.pm b/t/lib/DBICTest.pm index 8f1521c..5e518b1 100755 --- a/t/lib/DBICTest.pm +++ b/t/lib/DBICTest.pm @@ -55,12 +55,18 @@ sub init_schema { my $dbuser = $ENV{"DBICTEST_DBUSER"} || ''; my $dbpass = $ENV{"DBICTEST_DBPASS"} || ''; - my $compose_method = ($args{compose_connection} - ? 'compose_connection' - : 'compose_namespace'); + my $schema; - my $schema = DBICTest::Schema->$compose_method('DBICTest') - ->connect($dsn, $dbuser, $dbpass, { AutoCommit => 1 }); + my @connect_info = ($dsn, $dbuser, $dbpass, { AutoCommit => 1 }); + + if ($args{compose_connection}) { + $schema = DBICTest::Schema->compose_connection( + 'DBICTest', @connect_info + ); + } else { + $schema = DBICTest::Schema->compose_namespace('DBICTest') + ->connect(@connect_info); + } $schema->storage->on_connect_do(['PRAGMA synchronous = OFF']); if ( !$args{no_deploy} ) { __PACKAGE__->deploy_schema( $schema );