org.hibernate.exception.ConstraintViolationException: could not execute statement

Atlassian JIRA | William Ing | 10 months ago
  1. 0

    We tried to remove a directory from crowd (Microsoft Active Directory) but it fails with the "could not execute statement" error. Logs show: {code} 2016-02-02 16:20:58,927 http-bio-18095-exec-4 WARN [engine.jdbc.spi.SqlExceptionHelper] SQL Error: 0, SQLState: 23503 2016-02-02 16:20:58,927 http-bio-18095-exec-4 ERROR [engine.jdbc.spi.SqlExceptionHelper] ERROR: update or delete on table "cwd_user" violates foreign key constraint "fk_user_attribute_id_user_id" on table "cwd_user_attribute" Detail: Key (id)=(16220293) is still referenced from table "cwd_user_attribute". 2016-02-02 16:20:58,928 http-bio-18095-exec-4 ERROR [console.action.directory.RemoveDirectory] 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:124) at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:109) at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:189) at org.hibernate.hql.internal.ast.exec.BasicExecutor.doExecute(BasicExecutor.java:108) {code}

    Atlassian JIRA | 10 months ago | William Ing
    org.hibernate.exception.ConstraintViolationException: could not execute statement
  2. 0

    We tried to remove a directory from crowd (Microsoft Active Directory) but it fails with the "could not execute statement" error. Logs show: {code} 2016-02-02 16:20:58,927 http-bio-18095-exec-4 WARN [engine.jdbc.spi.SqlExceptionHelper] SQL Error: 0, SQLState: 23503 2016-02-02 16:20:58,927 http-bio-18095-exec-4 ERROR [engine.jdbc.spi.SqlExceptionHelper] ERROR: update or delete on table "cwd_user" violates foreign key constraint "fk_user_attribute_id_user_id" on table "cwd_user_attribute" Detail: Key (id)=(16220293) is still referenced from table "cwd_user_attribute". 2016-02-02 16:20:58,928 http-bio-18095-exec-4 ERROR [console.action.directory.RemoveDirectory] 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:124) at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:109) at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:189) at org.hibernate.hql.internal.ast.exec.BasicExecutor.doExecute(BasicExecutor.java:108) {code}

    Atlassian JIRA | 10 months ago | William Ing
    org.hibernate.exception.ConstraintViolationException: could not execute statement
  3. 0

    [KEYCLOAK-1820] Oracle Upgrade 1.1.0.Final -> 1.5.0.Final-SNAPSHOT fails - JBoss Issue Tracker

    jboss.org | 1 year ago
    org.keycloak.models.ModelDuplicateException: javax.persistence.PersistenceException: org.hibernate.exception.ConstraintViolationException: could not execute statement
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Read status not migrated from 1.x

    GitHub | 2 years ago | alanpearce
    org.hibernate.exception.ConstraintViolationException: could not execute statement
  6. 0

    Statement executed despite exception preceeding it

    Stack Overflow | 3 years ago | WebViewer
    org.hibernate.exception.ConstraintViolationException: could not execute statement

    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.hibernate.exception.ConstraintViolationException

      could not execute statement

      at org.hibernate.exception.internal.SQLStateConversionDelegate.convert()
    2. Hibernate
      BasicExecutor.doExecute
      1. org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:129)
      2. org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49)
      3. org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:124)
      4. org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:109)
      5. org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:189)
      6. org.hibernate.hql.internal.ast.exec.BasicExecutor.doExecute(BasicExecutor.java:108)
      6 frames