IQSS / dataverse-frontend

An upcoming and modernized UI for Dataverse

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dataverse Optimistic Lock Exception when calling DatasetHelper.destroyAll()

ekraffmiller opened this issue · comments

This error occurs in DatasetJSDataverseRepository.spec.ts when there are many Datasets in the server (for example, after running Dataset.spec.ts).

In the test "gets the total dataset count", DatasetHelper.destroyAll() fails because one of the calls to the delete API returns a 500 error:

{
    "status": "ERROR",
    "message": "Command edu.harvard.iq.dataverse.engine.command.impl.DeleteDataFileCommand@7ab8bb74 failed: Exception thrown from bean: jakarta.ejb.EJBTransactionRolledbackException: Exception thrown from bean: jakarta.persistence.OptimisticLockException: Exception [EclipseLink-5003] (Eclipse Persistence Services - 4.0.1.payara-p1.v202304041433): org.eclipse.persistence.exceptions.OptimisticLockException\nException Description: The object [edu.harvard.iq.dataverse.FileMetadata[id=1402]] cannot be deleted because it has changed or been deleted since it was last read. \nClass> edu.harvard.iq.dataverse.FileMetadata Primary Key> 1,402"
}

It is happening in this run: https://github.com/IQSS/dataverse-frontend/actions/runs/7662503764/job/20883838264

I created another issue to address this: #294