Bugzilla – Attachment 161219 Details for
Bug 35165
Batch item deletions are run in a single transaction and cause locking issues
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35165: Do not delete items in a transaction
Bug-35165-Do-not-delete-items-in-a-transaction.patch (text/plain), 1.94 KB, created by
Nick Clemens (kidclamp)
on 2024-01-19 19:16:48 UTC
(
hide
)
Description:
Bug 35165: Do not delete items in a transaction
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2024-01-19 19:16:48 UTC
Size:
1.94 KB
patch
obsolete
>From 1240261a4eb879eb2d46f10ef54c92f3baa51c28 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 19 Jan 2024 19:06:28 +0000 >Subject: [PATCH] Bug 35165: Do not delete items in a transaction > >We are testing the deletion with safe_delete before removing, beyond that I think the intent >was to delete all of the items, deleting some is better than not deleting any. > >To test: >1 - Apply patch, restart all >2 - Submit a batch deletion >3 - Confirm items are deleted >--- > Koha/BackgroundJob/BatchDeleteItem.pm | 8 -------- > 1 file changed, 8 deletions(-) > >diff --git a/Koha/BackgroundJob/BatchDeleteItem.pm b/Koha/BackgroundJob/BatchDeleteItem.pm >index 474450e57b2..6c15bbc1587 100644 >--- a/Koha/BackgroundJob/BatchDeleteItem.pm >+++ b/Koha/BackgroundJob/BatchDeleteItem.pm >@@ -94,9 +94,6 @@ sub process { > @deleted_biblionumbers ); > > try { >- my $schema = Koha::Database->new->schema; >- $schema->txn_do( >- sub { > my (@biblionumbers); > for my $record_id ( sort { $a <=> $b } @record_ids ) { > >@@ -107,7 +104,6 @@ sub process { > my $return = $item->safe_delete({ skip_record_index => 1, skip_holds_queue => 1 }); > unless ( $return ) { > >- # FIXME Do we need to rollback the whole transaction if a deletion failed? > push @not_deleted_itemnumbers, $item->itemnumber; > push @messages, > { >@@ -173,8 +169,6 @@ sub process { > } > ) if C4::Context->preference('RealTimeHoldsQueue'); > } >- } >- ); > } > catch { > >@@ -187,8 +181,6 @@ sub process { > error => $_, > }; > >- die "Something terrible has happened!" >- if ( $_ =~ /Rollback failed/ ); # Rollback failed > }; > > $report->{deleted_itemnumbers} = \@deleted_itemnumbers; >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 35165
:
161219
|
161220
|
161368
|
161369
|
161370
|
161480