org.hibernate.exception.ConstraintViolationException: could not delete: [com.springsource.insight.repo.resource.persist.PersistedApplicationResource#189]

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Samebug tips

,
Expert tip

Check if you're not creating unused SQL entities, as it might cause this exception.

Solutions on the web

via Spring JIRA by Bruce Edge, 1 year ago
could not delete: [com.springsource.insight.repo.resource.persist.PersistedApplicationResource#189]
via Spring JIRA by Bruce Edge, 1 year ago
could not delete: [com.springsource.insight.repo.resource.persist.PersistedApplicationResource#189]
via Stack Overflow by Alex
, 2 years ago
via GitHub by GoogleCodeExporter
, 2 years ago
via sourceforge.net by Unknown author, 2 years ago
via Stack Overflow by eightvds
, 2 years ago
org.h2.jdbc.JdbcSQLException: Referential integrity constraint violation: "FK_RESOURCES_APPLICATION: PUBLIC.RESOURCES FOREIGN KEY(APPLICATION) REFERENCES PUBLIC.RESOURCES(ID)"; SQL statement: delete from resources where id=? and version=? [23003-147]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:327)
at org.h2.message.DbException.get(DbException.java:167)
at org.h2.message.DbException.get(DbException.java:144)
at org.h2.constraint.ConstraintReferential.checkRow(ConstraintReferential.java:382)
at org.h2.constraint.ConstraintReferential.checkRowRefTable(ConstraintReferential.java:399)
at org.h2.constraint.ConstraintReferential.checkRow(ConstraintReferential.java:275)
at org.h2.table.Table.fireConstraints(Table.java:812)
at org.h2.table.Table.fireAfterRow(Table.java:829)
at org.h2.command.dml.Delete.update(Delete.java:80)
at org.h2.command.CommandContainer.update(CommandContainer.java:69)
at org.h2.command.Command.executeUpdate(Command.java:201)
at org.h2.jdbc.JdbcPreparedStatement.executeUpdateInternal(JdbcPreparedStatement.java:143)
at org.h2.jdbc.JdbcPreparedStatement.executeUpdate(JdbcPreparedStatement.java:129)
at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2692)
at org.hibernate.action.EntityDeleteAction.execute(EntityDeleteAction.java:97)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:273)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:265)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
at org.hibernate.event.def.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:64)
at org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:1185)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1261)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
at com.springsource.insight.repo.resource.persist.JpaResourceDAO.getResource(JpaResourceDAO.java:74)
at com.springsource.insight.repo.resource.persist.JpaResourceDAO.findResource(JpaResourceDAO.java:63)
at sun.reflect.GeneratedMethodAccessor78.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:155)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at com.springsource.insight.repo.resource.persist.PersistedResourceRepo.removeResource(PersistedResourceRepo.java:175)
at sun.reflect.GeneratedMethodAccessor79.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at com.springsource.insight.repo.purge.IncrementalPurgerImpl.purgeResources(IncrementalPurgerImpl.java:86)
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.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at com.springsource.insight.repo.purge.PurgeServiceImpl.purgeResources(PurgeServiceImpl.java:145)
at com.springsource.insight.repo.purge.PurgeServiceImpl.purgeData(PurgeServiceImpl.java:121)
at com.springsource.insight.repo.purge.PurgeServiceImpl.purgeExpiredData(PurgeServiceImpl.java:87)
at com.springsource.insight.repo.purge.PurgeServiceImpl$2.run(PurgeServiceImpl.java:177)
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:680)

Users with the same issue

3 times, 3 hours ago
9 times, 2 weeks ago
22 times, 3 weeks ago
2 times, 1 month ago
Once, 2 months ago

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.