From: Rafael Kitover Date: Sun, 26 Jul 2009 16:04:29 +0000 (+0000) Subject: SAVEPOINT methods for MSSQL X-Git-Tag: v0.08109~47^2~21 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4c0f4206348c9487fb0f55660e71ed9b5e150543;p=dbsrgits%2FDBIx-Class.git SAVEPOINT methods for MSSQL --- diff --git a/lib/DBIx/Class/Storage/DBI/MSSQL.pm b/lib/DBIx/Class/Storage/DBI/MSSQL.pm index a03e8a3..d9cd2ee 100644 --- a/lib/DBIx/Class/Storage/DBI/MSSQL.pm +++ b/lib/DBIx/Class/Storage/DBI/MSSQL.pm @@ -103,6 +103,23 @@ sub _fetch_identity { sub last_insert_id { shift->_identity } +# savepoint syntax is the same as in Sybase ASE + +sub _svp_begin { + my ($self, $name) = @_; + + $self->dbh->do("SAVE TRANSACTION $name"); +} + +# A new SAVE TRANSACTION with the same name releases the previous one. +sub _svp_release { 1 } + +sub _svp_rollback { + my ($self, $name) = @_; + + $self->dbh->do("ROLLBACK TRANSACTION $name"); +} + sub build_datetime_parser { my $self = shift; my $type = "DateTime::Format::Strptime";