From 9d71288d835ae54f4c1d64ca96a1bdefc0d03a14 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 22 Feb 2018 16:25:52 -0300 Subject: [PATCH] Bug 20287: Use DBIC transaction instead of AutoCommit=0 Remove error "Already in a transaction" Signed-off-by: Josef Moravec Signed-off-by: Tomas Cohen Arazi Signed-off-by: Martin Renvoize --- t/db_dependent/Utils/Datatables_Virtualshelves.t | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/t/db_dependent/Utils/Datatables_Virtualshelves.t b/t/db_dependent/Utils/Datatables_Virtualshelves.t index 564a08ddc4..cdc7225033 100644 --- a/t/db_dependent/Utils/Datatables_Virtualshelves.t +++ b/t/db_dependent/Utils/Datatables_Virtualshelves.t @@ -29,12 +29,10 @@ use Koha::Virtualshelves; use_ok( "C4::Utils::DataTables::VirtualShelves" ); +my $schema = Koha::Database->new->schema; +$schema->storage->txn_begin; my $dbh = C4::Context->dbh; -# Start transaction -$dbh->{AutoCommit} = 0; -$dbh->{RaiseError} = 1; - $dbh->do(q|DELETE FROM virtualshelves|); # Pick a categorycode from the DB -- 2.11.0