From: Peter Rabbitson <ribasushi@cpan.org>
Date: Wed, 5 Aug 2009 10:32:09 +0000 (+0000)
Subject: Changes and a deploy() fix
X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=13a3e374b0dc91adc8c2a682f4a7147c56ad0828;p=dbsrgits%2FDBIx-Class-Historic.git

Changes and a deploy() fix
---

diff --git a/Changes b/Changes
index 9b7da53..3774003 100644
--- a/Changes
+++ b/Changes
@@ -29,9 +29,13 @@ Revision history for DBIx::Class
             problems with search_related chaining
           - Deal with the distinct => 1 attribute properly when using
             prefetch
+        - Massive optimization of the DBI storage layer - reduce the
+          amount of connected() calls
+        - New ::Storage::DBI method last_dbh() - it will still return a
+          newly connected $dbh if we start unconnected, but will not ping
+          the server on every invocation unlike dbh()
         - Multiple POD improvements
 
-
 0.08108 2009-07-05 23:15:00 (UTC)
         - Fixed the has_many prefetch with limit/group deficiency -
           it is now possible to select "top 5 commenters" while
diff --git a/lib/DBIx/Class/Storage/DBI.pm b/lib/DBIx/Class/Storage/DBI.pm
index 121a2ca..a91346c 100644
--- a/lib/DBIx/Class/Storage/DBI.pm
+++ b/lib/DBIx/Class/Storage/DBI.pm
@@ -2310,7 +2310,10 @@ sub deploy {
     return if $line =~ /^\s+$/; # skip whitespace only
     $self->_query_start($line);
     eval {
-      $self->last_dbh->do($line);
+      # a previous error may invalidate $dbh - thus we need to use dbh()
+      # to guarantee a healthy $dbh (this is temporary until we get
+      # proper error handling on deploy() )
+      $self->dbh->do($line);
     };
     if ($@) {
       carp qq{$@ (running "${line}")};