Upon deeper inspection, it seems it deletes the first record (partially?) and then starts deleting the other, but then deletes the bitstream and dspaceobject of the first record (?). At this point it tries to delete the mostrecentchecksum and detects another thread doing an operation, which causes the exception (that's what I think it's happening).
2017-08-23 11:28:55,399 DEBUG org.dspace.storage.bitstore. BitstreamStorageServiceImpl @ bitstore.about is empty, so file is not present 2017-08-23 11:28:55,399 DEBUG org.dspace.storage.bitstore. BitstreamStorageServiceImpl @ deleting record 2017-08-23 11:28:55,420 DEBUG org.hibernate.hql.internal.ast. QueryTranslatorImpl @ parse() - HQL: delete from org.dspace.checker. MostRecentChecksum WHERE bitstream=:bitstream 2017-08-23 11:28:55,725 DEBUG org.hibernate.SQL @ delete from public.most_recent_checksum where bitstream_id=? 2017-08-23 11:28:55,729 DEBUG org.hibernate.hql.internal.ast. QueryTranslatorImpl @ parse() - HQL: delete from org.dspace.checker. ChecksumHistory where bitstream=:bitstream 2017-08-23 11:28:55,909 DEBUG org.hibernate.SQL @ delete from public.checksum_history where bitstream_id=? 2017-08-23 11:28:55,927 DEBUG org.dspace.storage.bitstore. BitstreamStorageServiceImpl @ bitstore.about is empty, so file is not present 2017-08-23 11:28:55,927 DEBUG org.dspace.storage.bitstore. BitstreamStorageServiceImpl @ deleting record 2017-08-23 11:28:56,059 DEBUG org.hibernate.SQL @ delete from public.bitstream where uuid=? 2017-08-23 11:28:56,066 DEBUG org.hibernate.SQL @ delete from public.dspaceobject where uuid=? According to the code, it commits every 100 items (or when completed). The actual file is deleted before the database operations, hence both files are not present. Maybe this is a bug and should go to the DSpace Jira? On Wednesday, August 23, 2017 at 11:41:25 AM UTC-3, Eduardo Speroni wrote: > > When I try to execute the cleanup script on DSpace 6.1 (tomcat 8), this is > the result: > > $/opt/dspace/bin/dspace cleanup -v > - Deleting bitstream information (ID: d9b9635b-8be3-4c0f-81ab- > 380b1839282e) > - Deleting bitstream record from database (ID: d9b9635b-8be3-4c0f-81ab- > 380b1839282e) > - Deleting bitstream information (ID: 96ebf52d-673b-4556-a973- > 9f25315d930f) > > dspace.log: > > 2017-08-23 11:34:56,219 ERROR org.hibernate.AssertionFailure @ HHH000099: > an assertion failure occured (this may indicate a bug in Hibernate, but is > more likely due to unsafe use of the session): org.hibernate. > AssertionFailure: possible nonthreadsafe access to session > 2017-08-23 11:34:56,223 FATAL org.dspace.storage.bitstore.Cleanup @ Caught > exception: > org.hibernate.AssertionFailure: possible nonthreadsafe access to session > at org.hibernate.action.internal.EntityDeleteAction.execute( > EntityDeleteAction.java:112) > at org.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java: > 395) > at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue > .java:387) > at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue > .java:310) > at org.hibernate.event.internal.AbstractFlushingEventListener. > performExecutions(AbstractFlushingEventListener.java:349) > at org.hibernate.event.internal.DefaultAutoFlushEventListener. > onAutoFlush(DefaultAutoFlushEventListener.java:67) > at org.hibernate.internal.SessionImpl.autoFlushIfRequired( > SessionImpl.java:1166) > at org.hibernate.internal.SessionImpl.executeUpdate(SessionImpl. > java:1246) > at org.hibernate.internal.QueryImpl.executeUpdate(QueryImpl.java: > 116) > at org.dspace.checker.dao.impl.MostRecentChecksumDAOImpl. > deleteByBitstream(MostRecentChecksumDAOImpl.java:102) > at org.dspace.checker.MostRecentChecksumServiceImpl. > deleteByBitstream(MostRecentChecksumServiceImpl.java:163) > at org.dspace.checker.ChecksumHistoryServiceImpl.deleteByBitstream > (ChecksumHistoryServiceImpl.java:108) > at org.dspace.storage.bitstore.BitstreamStorageServiceImpl.cleanup > (BitstreamStorageServiceImpl.java:250) > at org.dspace.storage.bitstore.Cleanup.main(Cleanup.java:79) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke( > NativeMethodAccessorImpl.java:57) > at sun.reflect.DelegatingMethodAccessorImpl.invoke( > DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:606) > at org.dspace.app.launcher.ScriptLauncher.runOneCommand( > ScriptLauncher.java:229) > > at org.dspace.app.launcher.ScriptLauncher.main(ScriptLauncher.java > :81) > > > Additional DEBUG logs: > > 2017-08-23 11:28:56,055 DEBUG org.hibernate.internal.util.EntityPrinter @ > More...... > 2017-08-23 11:28:56,059 DEBUG org.hibernate.SQL @ delete from > public.bitstream > where uuid=? > 2017-08-23 11:28:56,066 DEBUG org.hibernate.SQL @ delete from > public.dspaceobject > where uuid=? > 2017-08-23 11:28:56,070 ERROR org.hibernate.AssertionFailure @ HHH000099: > an assertion failure occured (this may indicate a bug in Hibernate, but is > more likely due to unsafe use of the session): org.hibernate. > AssertionFailure: possible nonthreadsafe access to session > > > Java information: > > $java -version > java version "1.7.0_131" > OpenJDK Runtime Environment (IcedTea 2.6.9) (7u131-2.6.9-2~deb8u1) > OpenJDK 64-Bit Server VM (build 24.131-b00, mixed mode) > > > > Anyone has any idea on how to solve this? Thanks! > > -- You received this message because you are subscribed to the Google Groups "DSpace Technical Support" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/dspace-tech. For more options, visit https://groups.google.com/d/optout.
