com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry 'James-Healey' for key 'UNQ_players_0' Error Code: 1062 Call: INSERT INTO players (email, dob, lastname, firstname, photo, birthcertificate, version, user) VALUES (?, ?, ?, ?, ?, ?, ?, ?) bind => [james@james.com, 1998-08-12, Healey, James, null, null, 1, 1] Query: InsertObjectQuery(uk.co.sportquest.entities.Player[id=null])

Oracle Community | healeyb | 7 years ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    EclipseLink - that's a little more information than I needed (in the log..)

    Oracle Community | 7 years ago | healeyb
    com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry 'James-Healey' for key 'UNQ_players_0' Error Code: 1062 Call: INSERT INTO players (email, dob, lastname, firstname, photo, birthcertificate, version, user) VALUES (?, ?, ?, ?, ?, ?, ?, ?) bind => [james@james.com, 1998-08-12, Healey, James, null, null, 1, 1] Query: InsertObjectQuery(uk.co.sportquest.entities.Player[id=null])

    Root Cause Analysis

    1. com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException

      Duplicate entry 'James-Healey' for key 'UNQ_players_0' Error Code: 1062 Call: INSERT INTO players (email, dob, lastname, firstname, photo, birthcertificate, version, user) VALUES (?, ?, ?, ?, ?, ?, ?, ?) bind => [james@james.com, 1998-08-12, Healey, James, null, null, 1, 1] Query: InsertObjectQuery(uk.co.sportquest.entities.Player[id=null])

      at org.eclipse.persistence.exceptions.DatabaseException.sqlException()
    2. EclipseLink (non-OSGi)
      DatabaseQueryMechanism.insertObjectForWrite
      1. org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:324)
      2. org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeDirectNoSelect(DatabaseAccessor.java:800)
      3. org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeNoSelect(DatabaseAccessor.java:866)
      4. org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:586)
      5. org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:529)
      6. org.eclipse.persistence.internal.sessions.AbstractSession.executeCall(AbstractSession.java:914)
      7. org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:205)
      8. org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:191)
      9. org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.insertObject(DatasourceCallQueryMechanism.java:334)
      10. org.eclipse.persistence.internal.queries.StatementQueryMechanism.insertObject(StatementQueryMechanism.java:162)
      11. org.eclipse.persistence.internal.queries.StatementQueryMechanism.insertObject(StatementQueryMechanism.java:177)
      12. org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.insertObjectForWrite(DatabaseQueryMechanism.java:461)
      12 frames