org.springframework.dao.DataIntegrityViolationException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • - Fill up JIRA server data with a server that has high number of group memberships - Click "Next" to start the sync. - While the sync is happening, refresh the browser two times (leave a 5 second interval between refreshes) *Expected*: Sync page to load and continue to sync. Next button to be disabled until the sync finishes, status message to change to state that synchronization has finished. *Actual*: Sync page loads, status message no longer updates and the Next button is enabled (even though the sync is still occurring in the background). Confluence start with the admin user logged in but the screen states that it does not have permissions to access Confluence. This is due to the fact that the sync is not finished. Notes: - When the page is reloaded, there is an exception that is thrown in the log. - After the sync finishes, admin user is able to load Confluence normally. - The same thing happens if browser is closed and reopened. - Screen recording: http://screencast.com/t/Cedb0W7E5 {code} 2011-08-01 10:35:06,067 INFO [Long running task: Synchronising JIRA Directory] [atlassian.crowd.directory.DbCachingRemoteChangeOperations] addUserMembershipsForG roup added [ 9 ] user members to [ group224 ] in [ 53ms ] 2011-08-01 10:35:06,168 ERROR [Long running task: Unmigrated wiki markup migration Task] [sf.hibernate.util.JDBCExceptionReporter] logExceptions integrity constr aint violation: unique constraint or index violation; BANDANA_UNIQUE_KEY table: BANDANA -- referer: http://localhost:8089/confluence5/setup/connecttojirasyncdirectory-start.action | url: /confluence5/setup/finishsetup.action | userName: anonymous | action: finishsetup 2011-08-01 10:35:06,178 ERROR [Long running task: Unmigrated wiki markup migration Task] [sf.hibernate.impl.SessionImpl] execute Could not synchronize database s tate with session -- referer: http://localhost:8089/confluence5/setup/connecttojirasyncdirectory-start.action | url: /confluence5/setup/finishsetup.action | userName: anonymous | action: finishsetup 2011-08-01 10:35:06,179 ERROR [Long running task: Unmigrated wiki markup migration Task] [xhtml.migration.macro.RemigrationLongRunningTask] runInternal An error occurred during the long running macro migration task -- referer: http://localhost:8089/confluence5/setup/connecttojirasyncdirectory-start.action | url: /confluence5/setup/finishsetup.action | userName: anonymous | action: finishsetup org.springframework.dao.DataIntegrityViolationException: Hibernate operation: could not insert: [com.atlassian.confluence.setup.bandana.ConfluenceBandanaRecord#3 60475]; SQL []; integrity constraint violation: unique constraint or index violation; BANDANA_UNIQUE_KEY table: BANDANA; nested exception is java.sql.SQLExceptio n: integrity constraint violation: unique constraint or index violation; BANDANA_UNIQUE_KEY table: BANDANA at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:100) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72) at org.springframework.orm.hibernate.HibernateTransactionManager.convertJdbcAccessException(HibernateTransactionManager.java:619) at org.springframework.orm.hibernate.HibernateTransactionManager.convertHibernateAccessException(HibernateTransactionManager.java:605) at org.springframework.orm.hibernate.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:518) at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:732) at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:701) at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:321) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:116) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy24.store(Unknown Source) at com.atlassian.confluence.setup.bandana.ConfluenceCachingBandanaPersister.store(ConfluenceCachingBandanaPersister.java:130) at com.atlassian.bandana.DefaultBandanaManager.setValue(DefaultBandanaManager.java:48) at com.atlassian.confluence.content.render.xhtml.migration.macro.MacroMigrationService.setMigrationRequired(MacroMigrationService.java:201) at com.atlassian.confluence.content.render.xhtml.migration.macro.RemigrationLongRunningTask.runInternal(RemigrationLongRunningTask.java:79) at com.atlassian.confluence.util.longrunning.ConfluenceAbstractLongRunningTask.run(ConfluenceAbstractLongRunningTask.java:21) at com.atlassian.confluence.util.longrunning.ManagedTask.run(ManagedTask.java:35) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Caused by: java.sql.SQLException: integrity constraint violation: unique constraint or index violation; BANDANA_UNIQUE_KEY table: BANDANA at org.hsqldb.jdbc.Util.sqlException(Util.java:215) at org.hsqldb.jdbc.JDBCPreparedStatement.fetchResult(JDBCPreparedStatement.java:4613) at org.hsqldb.jdbc.JDBCPreparedStatement.executeUpdate(JDBCPreparedStatement.java:308) at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:105) at net.sf.hibernate.impl.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:22) at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:462) at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:436) at net.sf.hibernate.impl.ScheduledInsertion.execute(ScheduledInsertion.java:37) at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2447) at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2433) at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2390) at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2259) at net.sf.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:61) at org.springframework.orm.hibernate.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:510) ... 19 more Caused by: org.hsqldb.HsqlException: integrity constraint violation: unique constraint or index violation; BANDANA_UNIQUE_KEY table: BANDANA at org.hsqldb.error.Error.error(Error.java:131) at org.hsqldb.Constraint.getException(Constraint.java:913) at org.hsqldb.index.IndexAVLMemory.insert(IndexAVLMemory.java:236) at org.hsqldb.persist.RowStoreAVL.indexRow(RowStoreAVL.java:171) at org.hsqldb.TransactionManagerMVCC.addInsertAction(TransactionManagerMVCC.java:402) at org.hsqldb.Session.addInsertAction(Session.java:433) at org.hsqldb.Table.insertSingleRow(Table.java:2500) at org.hsqldb.StatementDML.insertSingleRow(StatementDML.java:820) at org.hsqldb.StatementInsert.getResult(StatementInsert.java:131) at org.hsqldb.StatementDMQL.execute(StatementDMQL.java:190) at org.hsqldb.Session.executeCompiledStatement(Session.java:1300) at org.hsqldb.Session.execute(Session.java:960) at org.hsqldb.jdbc.JDBCPreparedStatement.fetchResult(JDBCPreparedStatement.java:4605) ... 31 more {code}
    via by Piyawoot Songsiritat [Atlassian],
  • - Fill up JIRA server data with a server that has high number of group memberships - Click "Next" to start the sync. - While the sync is happening, refresh the browser two times (leave a 5 second interval between refreshes) *Expected*: Sync page to load and continue to sync. Next button to be disabled until the sync finishes, status message to change to state that synchronization has finished. *Actual*: Sync page loads, status message no longer updates and the Next button is enabled (even though the sync is still occurring in the background). Confluence start with the admin user logged in but the screen states that it does not have permissions to access Confluence. This is due to the fact that the sync is not finished. Notes: - When the page is reloaded, there is an exception that is thrown in the log. - After the sync finishes, admin user is able to load Confluence normally. - The same thing happens if browser is closed and reopened. - Screen recording: http://screencast.com/t/Cedb0W7E5 {code} 2011-08-01 10:35:06,067 INFO [Long running task: Synchronising JIRA Directory] [atlassian.crowd.directory.DbCachingRemoteChangeOperations] addUserMembershipsForG roup added [ 9 ] user members to [ group224 ] in [ 53ms ] 2011-08-01 10:35:06,168 ERROR [Long running task: Unmigrated wiki markup migration Task] [sf.hibernate.util.JDBCExceptionReporter] logExceptions integrity constr aint violation: unique constraint or index violation; BANDANA_UNIQUE_KEY table: BANDANA -- referer: http://localhost:8089/confluence5/setup/connecttojirasyncdirectory-start.action | url: /confluence5/setup/finishsetup.action | userName: anonymous | action: finishsetup 2011-08-01 10:35:06,178 ERROR [Long running task: Unmigrated wiki markup migration Task] [sf.hibernate.impl.SessionImpl] execute Could not synchronize database s tate with session -- referer: http://localhost:8089/confluence5/setup/connecttojirasyncdirectory-start.action | url: /confluence5/setup/finishsetup.action | userName: anonymous | action: finishsetup 2011-08-01 10:35:06,179 ERROR [Long running task: Unmigrated wiki markup migration Task] [xhtml.migration.macro.RemigrationLongRunningTask] runInternal An error occurred during the long running macro migration task -- referer: http://localhost:8089/confluence5/setup/connecttojirasyncdirectory-start.action | url: /confluence5/setup/finishsetup.action | userName: anonymous | action: finishsetup org.springframework.dao.DataIntegrityViolationException: Hibernate operation: could not insert: [com.atlassian.confluence.setup.bandana.ConfluenceBandanaRecord#3 60475]; SQL []; integrity constraint violation: unique constraint or index violation; BANDANA_UNIQUE_KEY table: BANDANA; nested exception is java.sql.SQLExceptio n: integrity constraint violation: unique constraint or index violation; BANDANA_UNIQUE_KEY table: BANDANA at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:100) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72) at org.springframework.orm.hibernate.HibernateTransactionManager.convertJdbcAccessException(HibernateTransactionManager.java:619) at org.springframework.orm.hibernate.HibernateTransactionManager.convertHibernateAccessException(HibernateTransactionManager.java:605) at org.springframework.orm.hibernate.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:518) at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:732) at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:701) at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:321) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:116) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy24.store(Unknown Source) at com.atlassian.confluence.setup.bandana.ConfluenceCachingBandanaPersister.store(ConfluenceCachingBandanaPersister.java:130) at com.atlassian.bandana.DefaultBandanaManager.setValue(DefaultBandanaManager.java:48) at com.atlassian.confluence.content.render.xhtml.migration.macro.MacroMigrationService.setMigrationRequired(MacroMigrationService.java:201) at com.atlassian.confluence.content.render.xhtml.migration.macro.RemigrationLongRunningTask.runInternal(RemigrationLongRunningTask.java:79) at com.atlassian.confluence.util.longrunning.ConfluenceAbstractLongRunningTask.run(ConfluenceAbstractLongRunningTask.java:21) at com.atlassian.confluence.util.longrunning.ManagedTask.run(ManagedTask.java:35) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Caused by: java.sql.SQLException: integrity constraint violation: unique constraint or index violation; BANDANA_UNIQUE_KEY table: BANDANA at org.hsqldb.jdbc.Util.sqlException(Util.java:215) at org.hsqldb.jdbc.JDBCPreparedStatement.fetchResult(JDBCPreparedStatement.java:4613) at org.hsqldb.jdbc.JDBCPreparedStatement.executeUpdate(JDBCPreparedStatement.java:308) at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:105) at net.sf.hibernate.impl.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:22) at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:462) at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:436) at net.sf.hibernate.impl.ScheduledInsertion.execute(ScheduledInsertion.java:37) at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2447) at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2433) at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2390) at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2259) at net.sf.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:61) at org.springframework.orm.hibernate.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:510) ... 19 more Caused by: org.hsqldb.HsqlException: integrity constraint violation: unique constraint or index violation; BANDANA_UNIQUE_KEY table: BANDANA at org.hsqldb.error.Error.error(Error.java:131) at org.hsqldb.Constraint.getException(Constraint.java:913) at org.hsqldb.index.IndexAVLMemory.insert(IndexAVLMemory.java:236) at org.hsqldb.persist.RowStoreAVL.indexRow(RowStoreAVL.java:171) at org.hsqldb.TransactionManagerMVCC.addInsertAction(TransactionManagerMVCC.java:402) at org.hsqldb.Session.addInsertAction(Session.java:433) at org.hsqldb.Table.insertSingleRow(Table.java:2500) at org.hsqldb.StatementDML.insertSingleRow(StatementDML.java:820) at org.hsqldb.StatementInsert.getResult(StatementInsert.java:131) at org.hsqldb.StatementDMQL.execute(StatementDMQL.java:190) at org.hsqldb.Session.executeCompiledStatement(Session.java:1300) at org.hsqldb.Session.execute(Session.java:960) at org.hsqldb.jdbc.JDBCPreparedStatement.fetchResult(JDBCPreparedStatement.java:4605) ... 31 more {code}
    via by Piyawoot Songsiritat [Atlassian],
  • foreign key no parent error
    via Stack Overflow by The Thom
    ,
  • Exception when sending initial load
    via symmetricds by yoxel
    ,
  • In relation to ROO-1537, if I use Hibernate instead of OpenJPA, I get further. The following works, but then I'll add another entity and the test break: project --topLevelPackage net.opentemperament persistence setup --provider HIBERNATE --database HYPERSONIC_IN_MEMORY entity --class ~.entities.Family --testAutomatically field string --fieldName name entity --class ~.entities.Temperament --testAutomatically field string --fieldName title field string --fieldName description field string --fieldName originalAuthor field reference --type ~entities.Family --fieldName family entity --class ~.entities.OnlineUser #--extends org.springframework.security.UserDetails --testAutomatically field string --fieldName fullname field string --fieldName email field reference --class ~.entities.Temperament --fieldName onlineAuthor --type ~.entities.OnlineUser entity --class ~.entities.Note --testAutomatically field string --fieldName name field reference --type ~.entities.Note --fieldName enharmonicTwin field number --fieldName indexFromA --type java.lang.Integer field reference --fieldName startingNote --type ~.entities.Note --class ~.entities.Temperament entity --class ~.entities.Comma --testAutomatically field string --fieldName name --notNull field number --fieldName ratio --type java.lang.Double field number --fieldName ratioInCents --type java.lang.Double field reference --type ~.entities.Comma --fieldName alias enum type --class ~.enums.IntervalType enum constant --name MinorSecond enum constant --name MajorSecond enum constant --name MinorThird enum constant --name MajorThird enum constant --name PureFourth enum constant --name PureFifth perform test 45 tests run beautifully. But, if I add my next entity, all goes wrong entity --class ~.entities.Deviation --testAutomatically field reference --type ~.entities.Note --fieldName lowestNote --notNull #field enum --type ~.enums.IntervalType --fieldName intervalType --notNull #field number --fieldName deviationValue --type java.lang.Double #field reference --type ~.entities.Comma --fieldName deviationType --notNull perform test Why is this? The errors I get are here: Running net.opentemperament.entities.NoteIntegrationTest 2010-10-12 00:01:17,554 [main] ERROR org.hibernate.util.JDBCExceptionReporter - integrity constraint violation: foreign key no action; FK16B7481578D0153 table: DEVIATION 2010-10-12 00:01:17,554 [main] ERROR org.hibernate.event.def.AbstractFlushingEventListener - Could not synchronize database state with session org.hibernate.exception.ConstraintViolationException: could not delete: [net.opentemperament.entities.Note#9] at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:96) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66) at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2712) at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2895) at org.hibernate.action.EntityDeleteAction.execute(EntityDeleteAction.java:97) at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:267) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:259) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:183) at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321) at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:51) at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1206) at org.hibernate.ejb.AbstractEntityManagerImpl.flush(AbstractEntityManagerImpl.java:791) at sun.reflect.GeneratedMethodAccessor14.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:240) at $Proxy32.flush(Unknown Source) at net.opentemperament.entities.Note_Roo_Entity.ajc$interMethod$net_opentemperament_entities_Note_Roo_Entity$net_opentemperament_entities_Note$flush(Note_Roo_Entity.aj:70) at net.opentemperament.entities.Note.flush(Note.java:1) at net.opentemperament.entities.Note_Roo_Entity.ajc$interMethodDispatch1$net_opentemperament_entities_Note_Roo_Entity$net_opentemperament_entities_Note$flush(Note_Roo_Entity.aj) at net.opentemperament.entities.NoteIntegrationTest_Roo_IntegrationTest.ajc$interMethod$net_opentemperament_entities_NoteIntegrationTest_Roo_IntegrationTest$net_opentemperament_entities_NoteIntegrationTest$testRemove(NoteIntegrationTest_Roo_IntegrationTest.aj:112) at net.opentemperament.entities.NoteIntegrationTest.testRemove(NoteIntegrationTest.java:1) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74) at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:82) at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:240) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61) at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70) at org.junit.runners.ParentRunner.run(ParentRunner.java:236) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:180) at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:59) at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:115) at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:102) at org.apache.maven.surefire.Surefire.run(Surefire.java:180) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:350) at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1021) Caused by: java.sql.SQLException: integrity constraint violation: foreign key no action; FK16B7481578D0153 table: DEVIATION at org.hsqldb.jdbc.Util.sqlException(Unknown Source) at org.hsqldb.jdbc.JDBCPreparedStatement.fetchResult(Unknown Source) at org.hsqldb.jdbc.JDBCPreparedStatement.executeUpdate(Unknown Source) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105) at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2694) ... 51 more Caused by: org.hsqldb.HsqlException: integrity constraint violation: foreign key no action; FK16B7481578D0153 table: DEVIATION at org.hsqldb.error.Error.error(Unknown Source) at org.hsqldb.StatementDML.performReferentialActions(Unknown Source) at org.hsqldb.StatementDML.delete(Unknown Source) at org.hsqldb.StatementDML.executeDeleteStatement(Unknown Source) at org.hsqldb.StatementDML.getResult(Unknown Source) at org.hsqldb.StatementDMQL.execute(Unknown Source) at org.hsqldb.Session.executeCompiledStatement(Unknown Source) at org.hsqldb.Session.execute(Unknown Source) ... 56 more Tests run: 9, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.131 sec <<< FAILURE!
    via by Niklas Saers,
  • In relation to ROO-1537, if I use Hibernate instead of OpenJPA, I get further. The following works, but then I'll add another entity and the test break: project --topLevelPackage net.opentemperament persistence setup --provider HIBERNATE --database HYPERSONIC_IN_MEMORY entity --class ~.entities.Family --testAutomatically field string --fieldName name entity --class ~.entities.Temperament --testAutomatically field string --fieldName title field string --fieldName description field string --fieldName originalAuthor field reference --type ~entities.Family --fieldName family entity --class ~.entities.OnlineUser #--extends org.springframework.security.UserDetails --testAutomatically field string --fieldName fullname field string --fieldName email field reference --class ~.entities.Temperament --fieldName onlineAuthor --type ~.entities.OnlineUser entity --class ~.entities.Note --testAutomatically field string --fieldName name field reference --type ~.entities.Note --fieldName enharmonicTwin field number --fieldName indexFromA --type java.lang.Integer field reference --fieldName startingNote --type ~.entities.Note --class ~.entities.Temperament entity --class ~.entities.Comma --testAutomatically field string --fieldName name --notNull field number --fieldName ratio --type java.lang.Double field number --fieldName ratioInCents --type java.lang.Double field reference --type ~.entities.Comma --fieldName alias enum type --class ~.enums.IntervalType enum constant --name MinorSecond enum constant --name MajorSecond enum constant --name MinorThird enum constant --name MajorThird enum constant --name PureFourth enum constant --name PureFifth perform test 45 tests run beautifully. But, if I add my next entity, all goes wrong entity --class ~.entities.Deviation --testAutomatically field reference --type ~.entities.Note --fieldName lowestNote --notNull #field enum --type ~.enums.IntervalType --fieldName intervalType --notNull #field number --fieldName deviationValue --type java.lang.Double #field reference --type ~.entities.Comma --fieldName deviationType --notNull perform test Why is this? The errors I get are here: Running net.opentemperament.entities.NoteIntegrationTest 2010-10-12 00:01:17,554 [main] ERROR org.hibernate.util.JDBCExceptionReporter - integrity constraint violation: foreign key no action; FK16B7481578D0153 table: DEVIATION 2010-10-12 00:01:17,554 [main] ERROR org.hibernate.event.def.AbstractFlushingEventListener - Could not synchronize database state with session org.hibernate.exception.ConstraintViolationException: could not delete: [net.opentemperament.entities.Note#9] at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:96) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66) at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2712) at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2895) at org.hibernate.action.EntityDeleteAction.execute(EntityDeleteAction.java:97) at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:267) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:259) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:183) at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321) at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:51) at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1206) at org.hibernate.ejb.AbstractEntityManagerImpl.flush(AbstractEntityManagerImpl.java:791) at sun.reflect.GeneratedMethodAccessor14.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:240) at $Proxy32.flush(Unknown Source) at net.opentemperament.entities.Note_Roo_Entity.ajc$interMethod$net_opentemperament_entities_Note_Roo_Entity$net_opentemperament_entities_Note$flush(Note_Roo_Entity.aj:70) at net.opentemperament.entities.Note.flush(Note.java:1) at net.opentemperament.entities.Note_Roo_Entity.ajc$interMethodDispatch1$net_opentemperament_entities_Note_Roo_Entity$net_opentemperament_entities_Note$flush(Note_Roo_Entity.aj) at net.opentemperament.entities.NoteIntegrationTest_Roo_IntegrationTest.ajc$interMethod$net_opentemperament_entities_NoteIntegrationTest_Roo_IntegrationTest$net_opentemperament_entities_NoteIntegrationTest$testRemove(NoteIntegrationTest_Roo_IntegrationTest.aj:112) at net.opentemperament.entities.NoteIntegrationTest.testRemove(NoteIntegrationTest.java:1) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74) at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:82) at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:240) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61) at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70) at org.junit.runners.ParentRunner.run(ParentRunner.java:236) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:180) at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:59) at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:115) at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:102) at org.apache.maven.surefire.Surefire.run(Surefire.java:180) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:350) at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1021) Caused by: java.sql.SQLException: integrity constraint violation: foreign key no action; FK16B7481578D0153 table: DEVIATION at org.hsqldb.jdbc.Util.sqlException(Unknown Source) at org.hsqldb.jdbc.JDBCPreparedStatement.fetchResult(Unknown Source) at org.hsqldb.jdbc.JDBCPreparedStatement.executeUpdate(Unknown Source) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105) at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2694) ... 51 more Caused by: org.hsqldb.HsqlException: integrity constraint violation: foreign key no action; FK16B7481578D0153 table: DEVIATION at org.hsqldb.error.Error.error(Unknown Source) at org.hsqldb.StatementDML.performReferentialActions(Unknown Source) at org.hsqldb.StatementDML.delete(Unknown Source) at org.hsqldb.StatementDML.executeDeleteStatement(Unknown Source) at org.hsqldb.StatementDML.getResult(Unknown Source) at org.hsqldb.StatementDMQL.execute(Unknown Source) at org.hsqldb.Session.executeCompiledStatement(Unknown Source) at org.hsqldb.Session.execute(Unknown Source) ... 56 more Tests run: 9, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.131 sec <<< FAILURE!
    via by Niklas Saers,
    • org.springframework.dao.DataIntegrityViolationException: Hibernate operation: could not insert: [com.atlassian.confluence.setup.bandana.ConfluenceBandanaRecord#3 60475]; SQL []; integrity constraint violation: unique constraint or index violation; BANDANA_UNIQUE_KEY table: BANDANA; nested exception is java.sql.SQLExceptio n: integrity constraint violation: unique constraint or index violation; BANDANA_UNIQUE_KEY table: BANDANA at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:100) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72) at org.springframework.orm.hibernate.HibernateTransactionManager.convertJdbcAccessException(HibernateTransactionManager.java:619) at org.springframework.orm.hibernate.HibernateTransactionManager.convertHibernateAccessException(HibernateTransactionManager.java:605) at org.springframework.orm.hibernate.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:518) at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:732) at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:701) at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:321) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:116) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy24.store(Unknown Source) at com.atlassian.confluence.setup.bandana.ConfluenceCachingBandanaPersister.store(ConfluenceCachingBandanaPersister.java:130) at com.atlassian.bandana.DefaultBandanaManager.setValue(DefaultBandanaManager.java:48) at com.atlassian.confluence.content.render.xhtml.migration.macro.MacroMigrationService.setMigrationRequired(MacroMigrationService.java:201) at com.atlassian.confluence.content.render.xhtml.migration.macro.RemigrationLongRunningTask.runInternal(RemigrationLongRunningTask.java:79) at com.atlassian.confluence.util.longrunning.ConfluenceAbstractLongRunningTask.run(ConfluenceAbstractLongRunningTask.java:21) at com.atlassian.confluence.util.longrunning.ManagedTask.run(ManagedTask.java:35) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Caused by: java.sql.SQLException: integrity constraint violation: unique constraint or index violation; BANDANA_UNIQUE_KEY table: BANDANA at org.hsqldb.jdbc.Util.sqlException(Util.java:215) at org.hsqldb.jdbc.JDBCPreparedStatement.fetchResult(JDBCPreparedStatement.java:4613) at org.hsqldb.jdbc.JDBCPreparedStatement.executeUpdate(JDBCPreparedStatement.java:308) at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:105) at net.sf.hibernate.impl.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:22) at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:462) at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:436) at net.sf.hibernate.impl.ScheduledInsertion.execute(ScheduledInsertion.java:37) at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2447) at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2433) at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2390) at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2259) at net.sf.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:61) at org.springframework.orm.hibernate.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:510) ... 19 more Caused by: org.hsqldb.HsqlException: integrity constraint violation: unique constraint or index violation; BANDANA_UNIQUE_KEY table: BANDANA at org.hsqldb.error.Error.error(Error.java:131) at org.hsqldb.Constraint.getException(Constraint.java:913) at org.hsqldb.index.IndexAVLMemory.insert(IndexAVLMemory.java:236) at org.hsqldb.persist.RowStoreAVL.indexRow(RowStoreAVL.java:171) at org.hsqldb.TransactionManagerMVCC.addInsertAction(TransactionManagerMVCC.java:402) at org.hsqldb.Session.addInsertAction(Session.java:433) at org.hsqldb.Table.insertSingleRow(Table.java:2500) at org.hsqldb.StatementDML.insertSingleRow(StatementDML.java:820) at org.hsqldb.StatementInsert.getResult(StatementInsert.java:131) at org.hsqldb.StatementDMQL.execute(StatementDMQL.java:190) at org.hsqldb.Session.executeCompiledStatement(Session.java:1300) at org.hsqldb.Session.execute(Session.java:960) at org.hsqldb.jdbc.JDBCPreparedStatement.fetchResult(JDBCPreparedStatement.java:4605) ... 31 more

    Users with the same issue

    Unknown visitor1 times, last one,
    Axelo
    2 times, last one,
    marcbouvierdav
    142 times, last one,
    Unknown visitor1 times, last one,
    Unknown User
    2 times, last one,
    92 more bugmates