line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package RDF::AllegroGraph::Transaction4; |
2
|
|
|
|
|
|
|
|
3
|
15
|
|
|
15
|
|
84
|
use strict; |
|
15
|
|
|
|
|
33
|
|
|
15
|
|
|
|
|
535
|
|
4
|
15
|
|
|
15
|
|
82
|
use warnings; |
|
15
|
|
|
|
|
27
|
|
|
15
|
|
|
|
|
454
|
|
5
|
|
|
|
|
|
|
|
6
|
15
|
|
|
15
|
|
89
|
use base qw(RDF::AllegroGraph::Session4); |
|
15
|
|
|
|
|
35
|
|
|
15
|
|
|
|
|
1294
|
|
7
|
|
|
|
|
|
|
|
8
|
15
|
|
|
15
|
|
149
|
use Data::Dumper; |
|
15
|
|
|
|
|
32
|
|
|
15
|
|
|
|
|
726
|
|
9
|
15
|
|
|
15
|
|
82
|
use feature "switch"; |
|
15
|
|
|
|
|
28
|
|
|
15
|
|
|
|
|
1094
|
|
10
|
|
|
|
|
|
|
|
11
|
15
|
|
|
15
|
|
89
|
use JSON; |
|
15
|
|
|
|
|
28
|
|
|
15
|
|
|
|
|
111
|
|
12
|
15
|
|
|
15
|
|
2161
|
use URI::Escape qw/uri_escape_utf8/; |
|
15
|
|
|
|
|
32
|
|
|
15
|
|
|
|
|
717
|
|
13
|
|
|
|
|
|
|
|
14
|
15
|
|
|
15
|
|
84
|
use HTTP::Request::Common; |
|
15
|
|
|
|
|
34
|
|
|
15
|
|
|
|
|
5477
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=pod |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=head1 NAME |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
RDF::AllegroGraph::Transaction4 - AllegroGraph transaction handle for AGv4 |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=head1 INTERFACE |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=cut |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub new { |
27
|
0
|
|
|
0
|
0
|
|
my $class = shift; |
28
|
0
|
|
|
|
|
|
return bless { @_ }, $class; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub DESTROY { |
32
|
0
|
|
|
0
|
|
|
my $self = shift; |
33
|
0
|
|
|
|
|
|
$self->rollback; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=pod |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head2 Methods (additional to L) |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=over |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=item B |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
Commits all changes done inside the transaction to the underlying model. |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
B: When the transaction object is still accessible, it will have the same content as the |
47
|
|
|
|
|
|
|
'mother' session. |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=cut |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub commit { |
52
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
53
|
0
|
|
|
|
|
|
my $url = new URI ($self->{path} . '/commit'); |
54
|
0
|
|
|
|
|
|
my $resp = $self->{CATALOG}->{SERVER}->{ua}->post ($url); |
55
|
0
|
0
|
|
|
|
|
die "protocol error: ".$resp->status_line.' ('.$resp->content.')' unless $resp->is_success; |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=pod |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=item B |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
Discards all changes. |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
B: When the transaction object is still accessible, it will be empty. |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=cut |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
sub rollback { |
69
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
70
|
0
|
|
|
|
|
|
my $url = new URI ($self->{path} . '/rollback'); |
71
|
0
|
|
|
|
|
|
my $resp = $self->{CATALOG}->{SERVER}->{ua}->post ($url); |
72
|
0
|
0
|
|
|
|
|
die "protocol error: ".$resp->status_line.' ('.$resp->content.')' unless $resp->is_success; |
73
|
|
|
|
|
|
|
} |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=pod |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=back |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=head1 AUTHOR |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
Robert Barta, C<< >> |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
Copyright 2011 Robert Barta, all rights reserved. |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it under the same terms as Perl |
88
|
|
|
|
|
|
|
itself. |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
L |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=cut |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
1; |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
__END__ |