Line 0
Link Here
|
0 |
- |
1 |
package t::lib::Database; |
|
|
2 |
|
3 |
use Modern::Perl; |
4 |
use C4::Context; |
5 |
use Koha::Database; |
6 |
|
7 |
sub dbh { |
8 |
my $dbh = C4::Context->dbh; |
9 |
my $schema = Koha::Database->new->schema; |
10 |
$schema->storage->txn_begin; |
11 |
$dbh->{RaiseError} = 1; |
12 |
return $dbh; |
13 |
} |
14 |
|
15 |
END { |
16 |
my $schema = Koha::Database->new->schema; |
17 |
$schema->storage->txn_rollback; |
18 |
}; |
19 |
|
20 |
1; |