Pattern selector

Most relevant patterns first. Most helpful ones displayed. Click here to show all.

  1. DelegatingStatement.execute() has thrown a MySQLIntegrityConstraintViolationException
    Commons DBCP
    0
    0
    0
  2. ConnectionImpl.execSQL() has thrown a MySQLIntegrityConstraintViolationException
    MySQL Connector/J
    113
    142
    23

Your stack trace compared to the selected pattern

Jump to solutionsExpand frames
com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry 'CustomerId' for key 'PRIMARY'
10 matching frames hidden
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2629)
    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2713)
    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2663)
    at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:888)
3 frames hidden

Solution

Alexander11 months ago

Check whether privilege has the "not null" restriction. If so it always has to have a value and can never be null.

A different reason could be a wrong implementation of a foreign key. Check whether you always correctly insert/update in both tables.

External results for this pattern (10)

  1. Jonathan Pricevia Google Groups1 week ago
    Could not execute JDBC batch update
    Show stack trace
  2. 吴冉波via Google Groups1 week ago
    Duplicate entry '115-67' for key 'permission_permission_meta_resource_uniq'
    Show stack trace
  3. TTTimWangvia GitHub1 month ago
    Column 'gift_id' cannot be null ; SQL []; Column 'gift_id' cannot be null; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Column 'gift_id' cannot be null
    Show stack trace
  4. cdmvirtvia GitHub1 month ago
    Cannot add or update a child row: a foreign key constraint fails (`mobhunting`.`mh_Bounties`, CONSTRAINT `mh_Bounties_Player_Id_1` FOREIGN KEY (`BOUNTYOWNER_ID`) REFERENCES `mh_Players` (`PLAYER_ID`) ON DELETE CASCADE)
    Show stack trace
  5. WENLINRONGvia GitHub2 months ago
    javax.persistence.PersistenceException: org.hibernate.exception.ConstraintViolationException: could not execute statement
    Show stack trace
  6. hh6plusvia Stack Overflow2 months ago
    Duplicate entry '2750633-163072083-袋-0' for key 'uk_unit_name'
    Show stack trace
  7. Jon Snowvia Stack Overflow2 months ago
  8. cthielenvia GitHub3 months ago
    could not execute statement; SQL [n/a]; constraint [sectionGroup_unique_courseId_termCode]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement
    Show stack trace
  9. ltwheelervia GitHub3 months ago
    could not execute statement; SQL [n/a]; constraint [TeachingCall_Instructor_TermCode]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement
    Show stack trace