line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package DBIx::Transaction::st; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
5
|
use DBI; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
48
|
|
4
|
1
|
|
|
1
|
|
5
|
use base q(DBI::st); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
585
|
|
5
|
1
|
|
|
1
|
|
7
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
37
|
|
6
|
1
|
|
|
1
|
|
6
|
use warnings (FATAL => 'all'); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
53
|
|
7
|
1
|
|
|
1
|
|
6
|
use Carp qw(croak); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
223
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
return 1; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub execute { |
12
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
13
|
0
|
|
|
|
|
|
my $rv = eval { DBI::st::execute($self, @_); }; |
|
0
|
|
|
|
|
|
|
14
|
0
|
0
|
|
|
|
|
if($@) { |
15
|
0
|
|
|
|
|
|
$self->{Database}->inc_transaction_error(caller, $self->errstr); |
16
|
0
|
|
|
|
|
|
croak "$@\n"; |
17
|
|
|
|
|
|
|
} |
18
|
0
|
0
|
|
|
|
|
if(!$rv) { |
19
|
0
|
|
|
|
|
|
$self->{Database}->inc_transaction_error(caller, $self->errstr); |
20
|
|
|
|
|
|
|
} |
21
|
0
|
|
|
|
|
|
return $rv; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=pod |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=head1 NAME |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
DBIx::Transaction::st - Statement handle when running under DBIx::Transaction |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=head1 DESCRIPTION |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
When you connect to a database using DBIx::Transaction, your statement handles |
33
|
|
|
|
|
|
|
will be C objects. When these statement handles are |
34
|
|
|
|
|
|
|
executed, C will notice when query errors occur, and |
35
|
|
|
|
|
|
|
let the database handle know. See |
36
|
|
|
|
|
|
|
L |
37
|
|
|
|
|
|
|
for more information. |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=head1 METHODS |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
C only overrides one standard L method: |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=over |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=item execute |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
Calls C on the underlying database layer. If an error |
48
|
|
|
|
|
|
|
occurs, this is recorded and you will not be able to issue a C |
49
|
|
|
|
|
|
|
for the current transaction. |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=back |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head1 SEE ALSO |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
L, L |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=cut |