From: Cory G Watson Date: Sun, 23 Mar 2008 23:52:13 +0000 (+0000) Subject: Remove unnecessary passing of $self->dbh as a separate param to savepoint methods X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=eeb8cfeb91eebb5bd979202c234c9facf71f0b25;p=dbsrgits%2FDBIx-Class-Historic.git Remove unnecessary passing of $self->dbh as a separate param to savepoint methods --- diff --git a/lib/DBIx/Class/Storage/DBI.pm b/lib/DBIx/Class/Storage/DBI.pm index de373aa..6a0085a 100644 --- a/lib/DBIx/Class/Storage/DBI.pm +++ b/lib/DBIx/Class/Storage/DBI.pm @@ -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 { diff --git a/lib/DBIx/Class/Storage/DBI/Oracle.pm b/lib/DBIx/Class/Storage/DBI/Oracle.pm index 778d12f..64bf9f1 100644 --- a/lib/DBIx/Class/Storage/DBI/Oracle.pm +++ b/lib/DBIx/Class/Storage/DBI/Oracle.pm @@ -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; diff --git a/lib/DBIx/Class/Storage/DBI/Pg.pm b/lib/DBIx/Class/Storage/DBI/Pg.pm index fdf308e..49ca40d 100644 --- a/lib/DBIx/Class/Storage/DBI/Pg.pm +++ b/lib/DBIx/Class/Storage/DBI/Pg.pm @@ -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; diff --git a/lib/DBIx/Class/Storage/DBI/mysql.pm b/lib/DBIx/Class/Storage/DBI/mysql.pm index 19b035c..ec36176 100644 --- a/lib/DBIx/Class/Storage/DBI/mysql.pm +++ b/lib/DBIx/Class/Storage/DBI/mysql.pm @@ -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;