| 1 | package DBIO::Sybase::Storage::ASE::TxnManager; | ||||||||||||||||||||||||||||||||||||||||||
| 2 | # ABSTRACT: Transaction and savepoint management for Sybase ASE | ||||||||||||||||||||||||||||||||||||||||||
| 3 | |||||||||||||||||||||||||||||||||||||||||||
| 4 | 34 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 5 | 34 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||||||||||
| 7 | 34 | our $VERSION = '0.900007'; | |||||||||||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||||||||||||
| 9 | 34 | ▶ | use namespace::clean; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||||||||||||||||
| 11 | # No requires - these methods expect the consuming class to have: | ||||||||||||||||||||||||||||||||||||||||||
| 12 | # _dbh, _is_bulk_storage, _began_bulk_work, next::method | ||||||||||||||||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||||||||||||||
| 14 | 136 | ▶ | sub _exec_txn_begin { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_exec_txn_begin: called CC=5 SCAR=19.4
| |||||||||||||||||||||||||||||||||||||||||||
| 15 | 136 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||||||||||||
| 17 | # bulkLogin=1 connections are always in a transaction, and can only call BEGIN | ||||||||||||||||||||||||||||||||||||||||||
| 18 | # TRAN once. However, we need to make sure there's a $dbh. | ||||||||||||||||||||||||||||||||||||||||||
| 19 | 136 | ▶ | return if $self->_is_bulk_storage && $self->_dbh && $self->_began_bulk_work; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%2/6
$self->_is_bulk_storage and $self->_dbh and $self->_began_bulk_work
$self->_is_bulk_storage and $self->_dbh
MC/DC0%0/3
$self->_is_bulk_storage and $self->_dbh and $self->_began_bulk_work
$self->_is_bulk_storage
$self->_dbh
$self->_began_bulk_work
Truth table25%1/4
A and B and C
A= $self->_is_bulk_storageB= $self->_dbhC= $self->_began_bulk_work
| |||||||||||||||||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||||||||||||||||
| 21 | 136 | $self->next::method(@_); | |||||||||||||||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||||||||||||||||
| 23 | 136 | ▶ | $self->_began_bulk_work(1) if $self->_is_bulk_storage; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 24 | } | ||||||||||||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||||||||||||
| 26 | # savepoint support using ASE syntax | ||||||||||||||||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||||||||||||||||
| 28 | 0 | ▶ | sub _exec_svp_begin { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_exec_svp_begin: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||
| 29 | 0 | my ($self, $name) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||||||||||||||||
| 31 | 0 | $self->_dbh->do("SAVE TRANSACTION $name"); | |||||||||||||||||||||||||||||||||||||||||
| 32 | } | ||||||||||||||||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||||||||||||||||
| 34 | # A new SAVE TRANSACTION with the same name releases the previous one. | ||||||||||||||||||||||||||||||||||||||||||
| 35 | 0 | ▶ | sub _exec_svp_release { 1 } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_exec_svp_release: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||||||||||||||||
| 37 | 0 | ▶ | sub _exec_svp_rollback { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_exec_svp_rollback: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||
| 38 | 0 | my ($self, $name) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||||||||||||||||
| 40 | 0 | $self->_dbh->do("ROLLBACK TRANSACTION $name"); | |||||||||||||||||||||||||||||||||||||||||
| 41 | } | ||||||||||||||||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||||||||||||||||
| 43 | 34 | 1; | |||||||||||||||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||||||||||||||||
| 45 | __END__ | ||||||||||||||||||||||||||||||||||||||||||