Some annotations tests in IndexedCollectionTest fail due to "foreign key constraint" failure on MySQL InnoDB

Description

Test following tests are failing due to "foreign key constraint fail" in MySQL:

org.hibernate.test.annotations.indexcoll.IndexedCollectionTest.testDefaultMapKey
org.hibernate.test.annotations.indexcoll.IndexedCollectionTest.testMapKeyToEntity
org.hibernate.test.annotations.indexcoll.IndexedCollectionTest.testComponentSubPropertyMapKey
org.hibernate.test.annotations.indexcoll.IndexedCollectionTest.testMapKeyEntityEntity

Sample stack trace of the failure:
org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:71)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:254)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:237)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:141)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
at org.hibernate.test.annotations.indexcoll.IndexedCollectionTest.testDefaultMapKey(Unknown Source)
at org.hibernate.test.annotations.TestCase.runTest(Unknown Source)
Caused by: java.sql.BatchUpdateException: Cannot add or update a child row: a foreign key constraint fails (`platformae/addressentry`, CONSTRAINT `FK181B28FE1355AC4A` FOREIGN KEY (`firstname`, `lastname`) REFERENCES `addressentry` (`firstname`, `lastname`))
at com.mysql.jdbc.ServerPreparedStatement.executeBatch(ServerPreparedStatement.java:665)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:247)

---------
these testes only fail on MySQL5InnoDBDialect AND MySQLInnoDBDialect, they pass MySQL5Dialect and MySQLDialect

Environment

MySQL InnoDB 5.0.x and 5.1.x

Activity

Show:
Strong Liu
December 15, 2009, 7:00 PM
Strong Liu
December 15, 2009, 7:16 PM

is this related to HHH-3940?

Gail Badner
December 16, 2009, 1:10 AM

I believe this is a duplicate of / https://jira.jboss.org/jira/browse/JBPAPP-2082 .

Strong Liu
December 16, 2009, 3:45 AM

duplicate by

Steve Ebersole
March 21, 2011, 7:05 PM

Bulk closing stale resolved issues

Assignee

Unassigned

Reporter

Strong Liu

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure