mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 10:04:21 +00:00
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:
@@ -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);
|
||||||
|
Reference in New Issue
Block a user