Sybase/Storage/ASE/TxnManager.pm

filter: Statementstmt 75.0% 15 / 20 Branchbran 50.0% 2 / 4 Conditioncond 33.3% 2 / 6 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 57.1% 4 / 7 Podpod n/a totaltotal 57.5% 23 / 40 CC 5 SCAR 13.8
CC
5
Cov
63%
_exec_txn_begin
7.0
_exec_svp_begin
2.0
_exec_svp_release
2.0
CRAP 4.0
« Sybase/Diff/Index.pm ↑ Summary Sybase/Introspect.pm »
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
BranchTrueFalseTotal
if $self->_is_bulk_storage and $self->_dbh and $self->_began_bulk_work 0 136 136
Condition33%2/6
$self->_is_bulk_storage and $self->_dbh and $self->_began_bulk_work
!ll&&!rl&&r
13600
$self->_is_bulk_storage and $self->_dbh
!ll&&!rl&&r
13600
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
ABCresult
0XX0
10X0
1100
1111
20  
21 136 $self->next::method(@_);
22  
23 136 ▶ $self->_began_bulk_work(1) if $self->_is_bulk_storage;
Branch: 1 branch
BranchTrueFalseTotal
if $self->_is_bulk_storage 0 136 136
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__
« Sybase/Diff/Index.pm ↑ Summary Sybase/Introspect.pm »