Bugzilla – Attachment 161368 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), 2.00 KB, created by
ByWater Sandboxes
on 2024-01-24 20:29:53 UTC
(
hide
)
Description:
Bug 35165: Do not delete items in a transaction
Filename:
MIME Type:
Creator:
ByWater Sandboxes
Created:
2024-01-24 20:29:53 UTC
Size:
2.00 KB
patch
obsolete
>From 7e0ba7ed5603dc18ad5c866d5d399e52882e9a55 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 > >Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org> >--- > Koha/BackgroundJob/BatchDeleteItem.pm | 8 -------- > 1 file changed, 8 deletions(-) > >diff --git a/Koha/BackgroundJob/BatchDeleteItem.pm b/Koha/BackgroundJob/BatchDeleteItem.pm >index 474450e57b..6c15bbc158 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