Skip to content

Commit

Permalink
Deletion of objects of large studies from storage system triggered b…
Browse files Browse the repository at this point in the history
…y deletion threshold may fail fix #4004
  • Loading branch information
gunterze committed Mar 27, 2023
1 parent bf0c39c commit 6c3efb0
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,7 @@ private Long countLocationsByUIDMap(UIDMap uidMap) {
.setParameter(1, uidMap).getSingleResult();
}

@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
public void removeOrMarkLocationAs(Location location, Location.Status status) {
if (countLocationsByMultiRef(location.getMultiReference()) > 1)
em.remove(location);
Expand All @@ -691,6 +692,7 @@ private void markLocationAs(Location location, Location.Status status) {
location.setStatus(status);
}

@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
public void removeOrphaned(UIDMap uidMap) {
if (countLocationsByUIDMap(uidMap) == 0)
em.remove(uidMap);
Expand Down

0 comments on commit 6c3efb0

Please sign in to comment.