Hi,
DSpace v6.2, JSPUI . . .
I'm currently working on a REST API integration between our CRIS and a DSpace v6.2 DEV system (upgraded from v4.2, and 3.x before that, and 1.4 before that!). As Workflow will be carried out in the CRIS, I want to remove the existing Workflow groups for all the relevant Collections from our DSpace, but I'm not having any luck.
If (as an Administrator) I go to an Edit Collection page and click "Delete" on either of the 2 Workflow steps we are using ("Accept/Reject/Edit Metadata" and "Edit Metadata"), I get the following Internal Server Error:
2017-12-18 14:03:05,648 WARN org.dspace.app.webui.servlet.DSpaceServlet @ michae...@stir.ac.uk:session_id=BD31AC823C9C7EF5DCF908B28E227ACE:ip_addr=139.153.86.2:general_jspui_error:org.hibernate.ObjectDeletedException\colon; deleted object would be re-saved by cascade (remove deleted object from associations)\colon; [org.dspace.authorize.ResourcePolicy#2902770]
org.hibernate.ObjectDeletedException: deleted object would be re-saved by cascade (remove deleted object from associations): [org.dspace.authorize.ResourcePolicy#2902770]
at org.hibernate.internal.SessionImpl.forceFlush(SessionImpl.java:1208)
at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:184)
at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:114)
at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:90)
at org.hibernate.internal.SessionImpl.fireSaveOrUpdate(SessionImpl.java:654)
at org.hibernate.internal.SessionImpl.saveOrUpdate(SessionImpl.java:646)
at org.hibernate.engine.spi.CascadingAction$5.cascade(CascadingAction.java:258)
at org.hibernate.engine.internal.Cascade.cascadeToOne(Cascade.java:396)
<snip>
- which appears to be telling me that I can't delete the Workflow group because it is still associated with something (but I'm not sure what!) . . .
. . . and if I try to first remove the ePeople/Groups from the Workflow Group, I also get an Internal System Error:
2017-12-18 14:18:55,451 WARN org.dspace.app.webui.servlet.DSpaceServlet @ work...@stir.ac.uk:session_id=892C49738C889568C97E4190EB484B63:ip_addr=139.153.86.2:general_jspui_error:java.util.ConcurrentModificationException
java.util.ConcurrentModificationException
at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:907)
at java.util.ArrayList$Itr.next(ArrayList.java:857)
at org.hibernate.collection.internal.AbstractPersistentCollection$IteratorProxy.next(AbstractPersistentCollection.java:810)
at org.dspace.app.webui.servlet.admin.GroupEditServlet.doDSPost(GroupEditServlet.java:206)
at org.dspace.app.webui.servlet.DSpaceServlet.processRequest(DSpaceServlet.java:122)
at org.dspace.app.webui.servlet.DSpaceServlet.doPost(DSpaceServlet.java:80)
- and if I try to simply delete the Group, I also get an error:
2017-12-18 14:21:29,734 ERROR org.hibernate.engine.jdbc.spi.SqlExceptionHelper @ ERROR: update or delete on table "epersongroup" violates foreign key constraint "collection_workflow_step_3_fkey" on table "collection"
Detail: Key (uuid)=(245798d7-ff77-415d-be09-e74ec1556079) is still referenced from table "collection".
2017-12-18 14:21:29,735 WARN org.dspace.app.webui.servlet.DSpaceServlet @ work...@stir.ac.uk:session_id=892C49738C889568C97E4190EB484B63:ip_addr=139.153.86.2:general_jspui_error:org.hibernate.exception.ConstraintViolationException\colon; could not execute statement
org.hibernate.exception.ConstraintViolationException: could not execute statement
at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:129)
at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49)
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:124)
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:109)
- which appears to be telling me that I can't delete the Group because it is still referenced (as a Workflow Group) in the database entry for the Collection (which brings me back to step 1!).
I've been through and checked (as best I can) that there aren't any items in Workflow for the Collection I'm trying to delete the Workflow groups for (and I tested against a wide range of Collections). I do note quite a lot of "partial submissions" (?) in the "workspaceitem" table, but I'm not able to delete Workflow groups related to Collections that don't appear in the "workspaceitem" table (so whilst this may be an issue for some Collections, it isn't the case for all Collections?).
I've had a poke about in JIRA (in case I'd hit a known bug) and the mailing list archives, but I couldn't find anything relevant, so I'm now at a loss as to how I should go about deleting all the required Workflow groups :-(
Am I doing something daft? Does anyone have any suggestions how I can safely delete existing Workflow groups?
Any assistance very gratefully received as I'm currently struggling to get past this and I'm totally held up until I do!
Cheers,
Mike
Michael White
Senior Developer
Business Applications and Integrations
T: (01786) 466877
A: G5, Airthrey Castle, University of Stirling, Stirling, FK9 4LA