SongDiff DuplicateId Error, is Save being called twice for same song?

Description

09/10/2018 01.59.41:GMT:SongSave:handleFailedSaveErrors:SEVERE: Unable to save changes:/music/Audials Sorted Music Neu/Various Artists/Dream Dance Vol. 19 (Compilation) (18)/Various Artists - Dream Dance Vol. 19 (Compilation) - 01 - 17 - Free Fall (Radio Mix).mp3 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:126)
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:112)
at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:211)
at org.hibernate.engine.jdbc.batch.internal.NonBatchingBatch.addToBatch(NonBatchingBatch.java:62)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3124)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3581)
at org.hibernate.action.internal.EntityInsertAction.execute(EntityInsertAction.java:104)
at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:465)
at org.hibernate.engine.spi.ActionQueue.executeInserts(ActionQueue.java:337)
at org.hibernate.engine.spi.ActionQueue.addInsertAction(ActionQueue.java:176)
at org.hibernate.engine.spi.ActionQueue.addAction(ActionQueue.java:216)
at org.hibernate.event.internal.AbstractSaveEventListener.addInsertAction(AbstractSaveEventListener.java:334)
at org.hibernate.event.internal.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:289)
at org.hibernate.event.internal.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:195)
at org.hibernate.event.internal.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:126)
at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:209)
at org.hibernate.event.internal.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:55)
at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:194)
at org.hibernate.event.internal.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:49)
at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:90)
at org.hibernate.internal.SessionImpl.fireSave(SessionImpl.java:715)
at org.hibernate.internal.SessionImpl.save(SessionImpl.java:707)
at org.hibernate.internal.SessionImpl.save(SessionImpl.java:702)
at com.jthink.songkong.db.SongChangesCache.saveChangesMade(SongChangesCache.java:29)
at com.jthink.songkong.analyse.analyser.SongSave.call(SongSave.java:160)
at com.jthink.songkong.analyse.analyser.SongSaver.saveSongsToFile(SongSaver.java:265)
at com.jthink.songkong.analyse.analyser.SongSaver.saveChanges(SongSaver.java:205)
at com.jthink.songkong.analyse.analyser.SongSaver.call(SongSaver.java:157)
at com.jthink.songkong.analyse.analyser.SongSaver.call(SongSaver.java:26)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.h2.jdbc.JdbcSQLException: Unique index or primary key violation: "PRIMARY KEY ON PUBLIC.SONGDIFF(RECNO)"; SQL statement:
insert into SongDiff (diff, recNo) values (?, ?) [23505-172]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:329)
at org.h2.message.DbException.get(DbException.java:169)
at org.h2.message.DbException.get(DbException.java:146)
at org.h2.index.PageDataIndex.getNewDuplicateKeyException(PageDataIndex.java:164)
at org.h2.index.PageDataIndex.add(PageDataIndex.java:142)
at org.h2.table.RegularTable.addRow(RegularTable.java:124)
at org.h2.command.dml.Insert.insertRows(Insert.java:126)
at org.h2.command.dml.Insert.update(Insert.java:86)
at org.h2.command.CommandContainer.update(CommandContainer.java:79)
at org.h2.command.Command.executeUpdate(Command.java:235)
at org.h2.jdbc.JdbcPreparedStatement.executeUpdateInternal(JdbcPreparedStatement.java:154)
at org.h2.jdbc.JdbcPreparedStatement.executeUpdate(JdbcPreparedStatement.java:140)
at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:147)
at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:208)
... 30 more
09/10/2018 01.59.41:GMT:Errors:addError:SEVERE: Adding Error:Unable to save changes: /music/Audials Sorted Music Neu/Various Artists/Dream Dance Vol. 19 (Compilation) (18)/Various Artists - Dream Dance Vol. 19 (Compilation) - 01 - 17 - Free Fall (Radio Mix).mp3 could not execute statement
java.lang.Exception
at com.jthink.songkong.analyse.general.Errors.addError(Errors.java:28)
at com.jthink.songkong.analyse.analyser.SongSave.handleFailedSaveErrors(SongSave.java:562)
at com.jthink.songkong.analyse.analyser.SongSave.call(SongSave.java:192)
at com.jthink.songkong.analyse.analyser.SongSaver.saveSongsToFile(SongSaver.java:265)
at com.jthink.songkong.analyse.analyser.SongSaver.saveChanges(SongSaver.java:205)
at com.jthink.songkong.analyse.analyser.SongSaver.call(SongSaver.java:157)
at com.jthink.songkong.analyse.analyser.SongSaver.call(SongSaver.java:26)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
09/10/2018 01.59.41:GMT:MusicBrainzUpdateSong:lookupDirectArtworkForRelease:WARNING: Lookup CoverArtArchive for:bad2e237-f9aa-438a-a7b4-56ef8e3ba54e
09/10/2018 01.59.41:GMT:SessionUtil:commitAndClose:SEVERE: null id in com.jthink.songlayer.SongChanges entry (don't flush the Session after an exception occurs)
org.hibernate.AssertionFailure: null id in com.jthink.songlayer.SongChanges entry (don't flush the Session after an exception occurs)
at org.hibernate.event.internal.DefaultFlushEntityEventListener.checkId(DefaultFlushEntityEventListener.java:77)
at org.hibernate.event.internal.DefaultFlushEntityEventListener.getValues(DefaultFlushEntityEventListener.java:192)
at org.hibernate.event.internal.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:152)
at org.hibernate.event.internal.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:231)
at org.hibernate.event.internal.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:102)
at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:55)
at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1258)
at org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:425)
at org.hibernate.engine.transaction.internal.jdbc.JdbcTransaction.beforeTransactionCommit(JdbcTransaction.java:101)
at org.hibernate.engine.transaction.spi.AbstractTransactionImpl.commit(AbstractTransactionImpl.java:177)
at com.jthink.songkong.util.SessionUtil.commitAndClose(SessionUtil.java:29)
at com.jthink.songkong.analyse.analyser.SongSave.call(SongSave.java:197)
at com.jthink.songkong.analyse.analyser.SongSaver.saveSongsToFile(SongSaver.java:265)
at com.jthink.songkong.analyse.analyser.SongSaver.saveChanges(SongSaver.java:205)
at com.jthink.songkong.analyse.analyser.SongSaver.call(SongSaver.java:157)
at com.jthink.songkong.analyse.analyser.SongSaver.call(SongSaver.java:26)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
09/10/2018 01.59.41:GMT:Errors:addError:SEVERE: Adding Error:null id in com.jthink.songlayer.SongChanges entry (don't flush the Session after an exception occurs)
java.lang.Exception
at com.jthink.songkong.analyse.general.Errors.addError(Errors.java:28)
at com.jthink.songkong.util.SessionUtil.commitAndClose(SessionUtil.java:35)
at com.jthink.songkong.analyse.analyser.SongSave.call(SongSave.java:197)
at com.jthink.songkong.analyse.analyser.SongSaver.saveSongsToFile(SongSaver.java:265)
at com.jthink.songkong.analyse.analyser.SongSaver.saveChanges(SongSaver.java:205)
at com.jthink.songkong.analyse.analyser.SongSaver.call(SongSaver.java:157)
at com.jthink.songkong.analyse.analyser.SongSaver.call(SongSaver.java:26)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

Environment

None

Status

Assignee

Unassigned

Reporter

IJabz

Labels

None

Forum Username

RThelen

os

None

Components

Fix versions

Affects versions

5.11

Priority

Major
Configure