-
Notifications
You must be signed in to change notification settings - Fork 476
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Batch Delete: Batch delete of files fails for non super user if dataset has thumbnail. #4024
Comments
@rbhatta99 - going to move this back to not started for now, feel free to pick it up once the Primefaces spike is moved on! |
…g deleted; even though we keep it in the previously published version, we don't want to keep it assigned as the dedicated dataset thumbnail) (#4024)
I've pulled this one back into dev., to quickly resolve the controversy with unintercepted exceptions, when things go wrong trying to delete physical files. |
…though the physical file could not be deleted for an unpublished datafile. (#4024)
OK, I reorganized some old code on the inside. Now I'm getting a proper error message: |
Back into code review it goes... |
Reported by a user, see RT 251413
User reported that they could not delete all files from a dataset using the top select all checkbox.
This happens if the user is not a superuser and at least one of the files generates a thumbnail that becomes the dataset thumbnail, such as an image file or pdf. It can happen with a single image file if it is the one used for dataset thumbnail but will prevent the batch from deleting. The server log error is:
Caused by: javax.persistence.PersistenceException: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: org.postgresql.util.PSQLException: ERROR: update or delete on table "dvobject" violates foreign key constraint "fk_dataset_thumbnailfile_id" on table "dataset"
Detail: Key (id)=(216596) is still referenced from table "dataset".
Error Code: 0
Call: DELETE FROM DVOBJECT WHERE (ID = ?)
bind => [1 parameter bound]
Query: DeleteObjectQuery([DataFile id:216596 name:null])
Note, there is a workaround: mark all for delete, deselect the one file used as thumbnail, batch delete, then delete the last file.
The text was updated successfully, but these errors were encountered: