View | Details | Raw Unified | Return to bug 17426
Collapse All | Expand All

(-)a/t/db_dependent/BackgroundJob.t (-1 / +1 lines)
Lines 12-18 my $query = new CGI; Link Here
12
12
13
# Generate a session id
13
# Generate a session id
14
my $dbh     = C4::Context->dbh;
14
my $dbh     = C4::Context->dbh;
15
$dbh->{AutoCommit} = 1;
15
$dbh->{AutoCommit} = 0;
16
$dbh->{RaiseError} = 1;
16
$dbh->{RaiseError} = 1;
17
17
18
my $session = C4::Auth::get_session;
18
my $session = C4::Auth::get_session;
(-)a/t/db_dependent/Patron/Borrower_Discharge.t (-11 / +3 lines)
Lines 15-21 Link Here
15
# with Koha; if not, see <http://www.gnu.org/licenses>.
15
# with Koha; if not, see <http://www.gnu.org/licenses>.
16
16
17
use Modern::Perl;
17
use Modern::Perl;
18
use Test::More tests => 17;
18
use Test::More tests => 18;
19
use Test::Warn;
19
use Test::Warn;
20
use MARC::Record;
20
use MARC::Record;
21
21
Lines 118-132 else { Link Here
118
          "Expected failure because of missing PDF::FromHTML.";
118
          "Expected failure because of missing PDF::FromHTML.";
119
}
119
}
120
120
121
# FIXME
121
# FIXME Should be a Koha::Object object
122
# At this point, there is a problem with the AutoCommit off
122
is( ref(Koha::Patron::Discharge::request({ borrowernumber => $patron->{borrowernumber} })), 'Koha::Schema::Result::Discharge', 'Discharge request sent' );
123
# The transaction is bloked into DBIx::Class::Storage::DBI::_dbh_execute
124
# line my $rv = $sth->execute();
125
# We are using 2 connections and the one used by Koha::Schema has the AutoCommit set to 1
126
# Even if we switch off this flag, the connection will be blocked.
127
# The error is:
128
# DBIx::Class::ResultSet::create(): DBI Exception: DBD::mysql::st execute failed: Lock wait timeout exceeded; try restarting transaction [for Statement "INSERT INTO discharges ( borrower, needed, validated) VALUES ( ?, ?, ? )" with ParamValues: 0='121', 1='2014-01-08T16:38:29', 2=undef] at /home/koha/src/Koha/DataObject/Discharge.pm line 33
129
#is( Koha::Service::Borrower::Discharge::request({ borrowernumber => $patron->{borrowernumber} }), 1, 'Discharge request sent' );
130
123
131
$schema->storage->txn_rollback;
124
$schema->storage->txn_rollback;
132
125
133
- 

Return to bug 17426