MySQL Forums
Forum List  »  Connector/ODBC

Duplicate key or integrity constraint violation
Posted by: Petar
Date: May 18, 2005 10:22AM

Hi all,
I use MySQL with Hibernate and JADE and when i treid to
start the project I got the following trace:

[java] (Agent2.Agent2 92 ) Contacting server... Please wait!
[java] (Agent.Agent 38 ) Committing DataStack in Agent
[java] (Agent.Agent 49 )
[java] (Agent.Agent 49 )
[java] (Agent.Agent 49 )
[java] (util.JDBCExceptionReporter 57 ) SQL Error: 1216, SQLState: 23000
[java] (util.JDBCExceptionReporter 58 ) Duplicate key or integrity constraint violation message from server: "Cannot add or update a child row: a foreign key constraint fails"
[java] (util.JDBCExceptionReporter 57 ) SQL Error: 1216, SQLState: 23000
[java] (util.JDBCExceptionReporter 58 ) Duplicate key or integrity constraint violation message from server: "Cannot add or update a child row: a foreign key constraint fails"
[java] (impl.SessionImpl 2399) Could not synchronize database state with session
[java] net.sf.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
[java] at net.sf.hibernate.exception.ErrorCodeConverter.convert(ErrorCodeConverter.java:73)
[java] at net.sf.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:30)
[java] at net.sf.hibernate.impl.BatcherImpl.convert(BatcherImpl.java:325)
[java] at net.sf.hibernate.impl.BatcherImpl.executeBatch(BatcherImpl.java:134)
[java] at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2441)
[java] at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2395)
[java] at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2260)
[java] at net.sf.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:61)
[java] at org.uctm.abss.agents.Agent.BehaviourA13_HandleCommitDataStack.action(BehaviourA13_HandleCommitDataStack.java:52)
[java] at jade.core.behaviours.Behaviour.actionWrapper(Unknown Source)
[java] at jade.core.Agent.mainLoop(Unknown Source)
[java] at jade.core.Agent.run(Unknown Source)
[java] at java.lang.Thread.run(Thread.java:534)
[java] Caused by: java.sql.BatchUpdateException: Duplicate key or integrity constraint violation message from server: "Cannot add or update a child row: a foreign key constraint fails"
[java] at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:1492)
[java] at com.mchange.v2.sql.filter.FilterPreparedStatement.executeBatch(FilterPreparedStatement.java:260)
[java] at net.sf.hibernate.impl.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:54)
[java] at net.sf.hibernate.impl.BatcherImpl.executeBatch(BatcherImpl.java:127)
[java] ... 9 more
Please if somebody knows how I may to avoid this problem let's show me the way!

Options: ReplyQuote


Subject
Written By
Posted
Duplicate key or integrity constraint violation
May 18, 2005 10:22AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.