Ensure updated and deleted books reflect correctly in library view
This commit is contained in:
committed by
Aditya Chandel
parent
230ff158e9
commit
17ba20fbe9
+2
@@ -111,6 +111,8 @@ public class LibraryProcessingService {
|
||||
@Transactional
|
||||
protected void deleteRemovedBooks(List<BookEntity> removedBookEntities) {
|
||||
if (!removedBookEntities.isEmpty()) {
|
||||
entityManager.flush();
|
||||
entityManager.clear();
|
||||
Set<Long> bookIds = removedBookEntities.stream().map(BookEntity::getId).collect(Collectors.toSet());
|
||||
bookRepository.deleteByIdIn(bookIds);
|
||||
notificationService.sendMessage(Topic.BOOKS_REMOVE, bookIds);
|
||||
|
||||
Reference in New Issue
Block a user