Remove unnecessary passing of $self->dbh as a separate param to savepoint methods
Cory G Watson [Sun, 23 Mar 2008 23:52:13 +0000 (23:52 +0000)]
lib/DBIx/Class/Storage/DBI.pm
lib/DBIx/Class/Storage/DBI/Oracle.pm
lib/DBIx/Class/Storage/DBI/Pg.pm
lib/DBIx/Class/Storage/DBI/mysql.pm

index de373aa..6a0085a 100644 (file)
@@ -882,7 +882,7 @@ sub svp_begin {
     return 0;
   }
   $self->debugobj->svp_begin($name) if $self->debug;
-  $self->_svp_begin($self->dbh(), $name);
+  $self->_svp_begin($name);
 }
 
 sub svp_release {
@@ -900,7 +900,7 @@ sub svp_release {
       return 0;
   }
   $self->debugobj->svp_release($name) if $self->debug;
-  $self->_svp_release($self->dbh(), $name);
+  $self->_svp_release($name);
 }
 
 sub svp_rollback {
@@ -918,7 +918,7 @@ sub svp_rollback {
       return 0;
   }
   $self->debugobj->svp_rollback($name) if $self->debug;
-  $self->_svp_rollback($self->dbh(), $name);
+  $self->_svp_rollback($name);
 }
 
 sub txn_begin {
index 778d12f..64bf9f1 100644 (file)
@@ -26,17 +26,17 @@ sub _rebless {
 }
 
 sub _svp_begin {
-    my ($self, $dbh, $name) = @_;
+    my ($self, $name) = @_;
  
-    $dbh->do("SAVEPOINT $name");
+    $self->dbh->do("SAVEPOINT $name");
 }
 
 # Would've implemented _svp_release here, but Oracle doesn't support it.
 
 sub _svp_rollback {
-    my ($self, $dbh, $name) = @_;
+    my ($self, $name) = @_;
 
-    $dbh->do("ROLLBACK TO SAVEPOINT $name")
+    $self->dbh->do("ROLLBACK TO SAVEPOINT $name")
 }
 
 1;
index fdf308e..49ca40d 100644 (file)
@@ -80,21 +80,21 @@ sub _sequence_fetch {
 }
 
 sub _svp_begin {
-    my ($self, $dbh, $name) = @_;
+    my ($self, $name) = @_;
 
-    $dbh->pg_savepoint($name);
+    $self->dbh->pg_savepoint($name);
 }
 
 sub _svp_release {
-    my ($self, $dbh, $name) = @_;
+    my ($self, $name) = @_;
 
-    $dbh->pg_release($name;)
+    $self->dbh->pg_release($name;)
 }
 
 sub _svp_rollback {
-    my ($self, $dbh, $name) = @_;
+    my ($self, $name) = @_;
 
-    $dbh->pg_rollback_to($name);
+    $self->dbh->pg_rollback_to($name);
 }
 
 1;
index 19b035c..ec36176 100644 (file)
@@ -17,21 +17,21 @@ sub sqlt_type {
 }
 
 sub _svp_begin {
-    my ($self, $dbh, $name) = @_;
+    my ($self, $name) = @_;
 
-    $dbh->do("SAVEPOINT $name");
+    $self->dbh->do("SAVEPOINT $name");
 }
 
 sub _svp_release {
-    my ($self, $dbh, $name) = @_;
+    my ($self, $name) = @_;
 
-    $dbh->do("RELEASE SAVEPOINT $name");
+    $self->dbh->do("RELEASE SAVEPOINT $name");
 }
 
 sub _svp_rollback {
-    my ($self, $dbh, $name) = @_;
+    my ($self, $name) = @_;
 
-    $dbh->do("ROLLBACK TO SAVEPOINT $name")
+    $self->dbh->do("ROLLBACK TO SAVEPOINT $name")
 }
 
 1;