File: 65transact.t

package info (click to toggle)
libdbi-perl 1.605-1
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 1,964 kB
  • ctags: 1,438
  • sloc: perl: 14,470; ansic: 563; makefile: 16
file content (35 lines) | stat: -rw-r--r-- 642 bytes parent folder | download | duplicates (9)
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;