Fix "Simultaneous deletion of multiple bitstreams from the same bundle often compromises the state of the bundle" (#8778)

* DS-8694

* clean imports

* cleaning code

* DS-8694 - re-deletion of bitstream throw exception

* ds-8694 - clean code
This commit is contained in:
Adán Román Ruiz
2023-05-11 23:59:38 +02:00
committed by GitHub
parent a2256ef8ec
commit 2cf5b290b6

View File

@@ -195,7 +195,11 @@ public abstract class DSpaceRestRepository<T extends RestAddressableModel, ID ex
/** /**
* Delete the object identified by its ID * Delete the object identified by its ID
*/ */
public void deleteById(ID id) { /**
* Method should be synchronized to avoid hibernate partial deletion bug when deleting multiple bitstreams:
* https://github.com/DSpace/DSpace/issues/8694
*/
public synchronized void deleteById(ID id) {
Context context = obtainContext(); Context context = obtainContext();
try { try {
getThisRepository().delete(context, id); getThisRepository().delete(context, id);