javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not get next sequence value

openxava | anitag | 8 years ago
  1. 0

    Problema con campo identity en postgresql

    openxava | 8 years ago | anitag
    javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not get next sequence value
  2. 0

    I created a new user on EAC, and all I did with it was.. create a Taskdoc entry, as far as I remember. Then I tried to delete the user again, but get this message. I logged back in, removed my taskdock entry, and tried again, same problem. Could be taskdock, could be something entirely different. It sucks though :-) {noformat} org.springframework.dao.DataIntegrityViolationException: Hibernate operation: could not delete: [com.atlassian.confluence.pages.Attachment#1778090269]; SQL []; ERROR: update or delete on table "attachments" violates foreign key constraint "fk9dc3e34d34a4917e" on table "attachmentdata" Detail: Key (attachmentid)=(1778090269) is still referenced from table "attachmentdata".; nested exception is org.postgresql.util.PSQLException: ERROR: update or delete on table "attachments" violates foreign key constraint "fk9dc3e34d34a4917e" on table "attachmentdata" Detail: Key (attachmentid)=(1778090269) is still referenced from table "attachmentdata". at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.translate(SQLStateSQLExceptionTranslator.java:110) caused by: org.postgresql.util.PSQLException: ERROR: update or delete on table "attachments" violates foreign key constraint "fk9dc3e34d34a4917e" on table "attachmentdata" Detail: Key (attachmentid)=(1778090269) is still referenced from table "attachmentdata". at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1608) Stack Trace:[hide] org.springframework.dao.DataIntegrityViolationException: Hibernate operation: could not delete: [com.atlassian.confluence.pages.Attachment#1778090269]; SQL []; ERROR: update or delete on table "attachments" violates foreign key constraint "fk9dc3e34d34a4917e" on table "attachmentdata" Detail: Key (attachmentid)=(1778090269) is still referenced from table "attachmentdata".; nested exception is org.postgresql.util.PSQLException: ERROR: update or delete on table "attachments" violates foreign key constraint "fk9dc3e34d34a4917e" on table "attachmentdata" Detail: Key (attachmentid)=(1778090269) is still referenced from table "attachmentdata". Caused by: org.postgresql.util.PSQLException: ERROR: update or delete on table "attachments" violates foreign key constraint "fk9dc3e34d34a4917e" on table "attachmentdata" Detail: Key (attachmentid)=(1778090269) is still referenced from table "attachmentdata". at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1608) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1343) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:195) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:452) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:351) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:305) at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:102) at net.sf.hibernate.impl.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:22) at net.sf.hibernate.persister.EntityPersister.delete(EntityPersister.java:581) at net.sf.hibernate.impl.ScheduledDeletion.execute(ScheduledDeletion.java:29) at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2449) at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2435) at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2397) at net.sf.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:1821) at net.sf.hibernate.impl.SessionImpl.findBySQL(SessionImpl.java:3863) at net.sf.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:52) at com.atlassian.confluence.pages.persistence.dao.hibernate.HibernatePageDao$5.doInHibernate(HibernatePageDao.java:538) at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:370) at org.springframework.orm.hibernate.HibernateTemplate.executeFind(HibernateTemplate.java:341) at com.atlassian.confluence.pages.persistence.dao.hibernate.HibernatePageDao.getDescendents(HibernatePageDao.java:528) at com.atlassian.confluence.pages.persistence.dao.hibernate.CachingPageDao.getDescendents(CachingPageDao.java:184) at com.atlassian.confluence.core.DefaultContentPermissionManager.reindexContent(DefaultContentPermissionManager.java:51) at com.atlassian.confluence.core.DefaultContentPermissionManager.removeContentPermission(DefaultContentPermissionManager.java:181) at com.atlassian.confluence.core.DefaultContentPermissionManager.removeContentPermissions(DefaultContentPermissionManager.java:204) at com.atlassian.confluence.core.DefaultContentPermissionManager.removeAllUserPermissions(DefaultContentPermissionManager.java:196) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) {noformat}

    Atlassian JIRA | 7 years ago | Per Fragemann [Atlassian]
    org.postgresql.util.PSQLException: ERROR: update or delete on table "attachments" violates foreign key constraint "fk9dc3e34d34a4917e" on table "attachmentdata" Detail: Key (attachmentid)=(1778090269) is still referenced from table "attachmentdata".
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    I created a new user on EAC, and all I did with it was.. create a Taskdoc entry, as far as I remember. Then I tried to delete the user again, but get this message. I logged back in, removed my taskdock entry, and tried again, same problem. Could be taskdock, could be something entirely different. It sucks though :-) {noformat} org.springframework.dao.DataIntegrityViolationException: Hibernate operation: could not delete: [com.atlassian.confluence.pages.Attachment#1778090269]; SQL []; ERROR: update or delete on table "attachments" violates foreign key constraint "fk9dc3e34d34a4917e" on table "attachmentdata" Detail: Key (attachmentid)=(1778090269) is still referenced from table "attachmentdata".; nested exception is org.postgresql.util.PSQLException: ERROR: update or delete on table "attachments" violates foreign key constraint "fk9dc3e34d34a4917e" on table "attachmentdata" Detail: Key (attachmentid)=(1778090269) is still referenced from table "attachmentdata". at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.translate(SQLStateSQLExceptionTranslator.java:110) caused by: org.postgresql.util.PSQLException: ERROR: update or delete on table "attachments" violates foreign key constraint "fk9dc3e34d34a4917e" on table "attachmentdata" Detail: Key (attachmentid)=(1778090269) is still referenced from table "attachmentdata". at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1608) Stack Trace:[hide] org.springframework.dao.DataIntegrityViolationException: Hibernate operation: could not delete: [com.atlassian.confluence.pages.Attachment#1778090269]; SQL []; ERROR: update or delete on table "attachments" violates foreign key constraint "fk9dc3e34d34a4917e" on table "attachmentdata" Detail: Key (attachmentid)=(1778090269) is still referenced from table "attachmentdata".; nested exception is org.postgresql.util.PSQLException: ERROR: update or delete on table "attachments" violates foreign key constraint "fk9dc3e34d34a4917e" on table "attachmentdata" Detail: Key (attachmentid)=(1778090269) is still referenced from table "attachmentdata". Caused by: org.postgresql.util.PSQLException: ERROR: update or delete on table "attachments" violates foreign key constraint "fk9dc3e34d34a4917e" on table "attachmentdata" Detail: Key (attachmentid)=(1778090269) is still referenced from table "attachmentdata". at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1608) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1343) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:195) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:452) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:351) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:305) at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:102) at net.sf.hibernate.impl.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:22) at net.sf.hibernate.persister.EntityPersister.delete(EntityPersister.java:581) at net.sf.hibernate.impl.ScheduledDeletion.execute(ScheduledDeletion.java:29) at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2449) at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2435) at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2397) at net.sf.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:1821) at net.sf.hibernate.impl.SessionImpl.findBySQL(SessionImpl.java:3863) at net.sf.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:52) at com.atlassian.confluence.pages.persistence.dao.hibernate.HibernatePageDao$5.doInHibernate(HibernatePageDao.java:538) at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:370) at org.springframework.orm.hibernate.HibernateTemplate.executeFind(HibernateTemplate.java:341) at com.atlassian.confluence.pages.persistence.dao.hibernate.HibernatePageDao.getDescendents(HibernatePageDao.java:528) at com.atlassian.confluence.pages.persistence.dao.hibernate.CachingPageDao.getDescendents(CachingPageDao.java:184) at com.atlassian.confluence.core.DefaultContentPermissionManager.reindexContent(DefaultContentPermissionManager.java:51) at com.atlassian.confluence.core.DefaultContentPermissionManager.removeContentPermission(DefaultContentPermissionManager.java:181) at com.atlassian.confluence.core.DefaultContentPermissionManager.removeContentPermissions(DefaultContentPermissionManager.java:204) at com.atlassian.confluence.core.DefaultContentPermissionManager.removeAllUserPermissions(DefaultContentPermissionManager.java:196) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) {noformat}

    Atlassian JIRA | 7 years ago | Per Fragemann [Atlassian]
    org.postgresql.util.PSQLException: ERROR: update or delete on table "attachments" violates foreign key constraint "fk9dc3e34d34a4917e" on table "attachmentdata" Detail: Key (attachmentid)=(1778090269) is still referenced from table "attachmentdata".

    1 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. org.postgresql.util.PSQLException

      ERROR: syntax error at or near "call"

      at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse()
    2. PostgreSQL JDBC Driver
      QueryExecutorImpl.receiveErrorResponse
      1. org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1608)
      1 frame
    3. org.apache.tomcat
      DelegatingPreparedStatement.executeQuery
      1. org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:92)
      1 frame
    4. Hibernate
      SequenceGenerator.generate
      1. org.hibernate.id.SequenceGenerator.generate(SequenceGenerator.java:98)
      2. org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:90)
      3. org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
      4. org.hibernate.id.SequenceGenerator.generate(SequenceGenerator.java:119)
      4 frames
    5. Hibernate EJB
      AbstractEntityManagerImpl.persist
      1. org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:614)
      2. org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:226)
      2 frames
    6. Grizzly HTTP
      LeaderFollowerWorkerThread.runIt
      1. org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
      1 frame
    7. Tomcat Util
      ThreadPool$ControlRunnable.run
      1. org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
      1 frame
    8. Java RT
      Thread.run
      1. java.lang.Thread.run(Unknown Source)
      1 frame