blob: f3d672be362952e484bce9c11a617f1d61100532 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
#!perl -w
$|=1;
use strict;
use DBI;
use Test::More;
plan skip_all => 'Transactions not supported by DBD::Gofer'
if $ENV{DBI_AUTOPROXY} && $ENV{DBI_AUTOPROXY} =~ /^dbi:Gofer/i;
plan tests => 10;
my $dbh = DBI->connect('dbi:ExampleP(AutoCommit=>1):', undef, undef)
or die "Unable to connect to ExampleP driver: $DBI::errstr";
print "begin_work...\n";
ok($dbh->{AutoCommit});
ok(!$dbh->{BegunWork});
ok($dbh->begin_work);
ok(!$dbh->{AutoCommit});
ok($dbh->{BegunWork});
$dbh->commit;
ok($dbh->{AutoCommit});
ok(!$dbh->{BegunWork});
ok($dbh->begin_work({}));
$dbh->rollback;
ok($dbh->{AutoCommit});
ok(!$dbh->{BegunWork});
1;
|