Hi,
I have an exception when running a tests suite against an Oracle database:
Quote:
2012-11-16 20:04:41,603 DEBUG [AbstractBatcher] about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
2012-11-16 20:04:41,603 DEBUG [SQL]
insert
into
navbar
(version, hide, id)
values
(?, ?, ?)
Hibernate:
insert
into
navbar
(version, hide, id)
values
(?, ?, ?)
2012-11-16 20:04:41,603 TRACE [BasicBinder] binding parameter [1] as [INTEGER] - 0
2012-11-16 20:04:41,603 TRACE [BasicBinder] binding parameter [2] as [BIT] - false
2012-11-16 20:04:41,603 TRACE [BasicBinder] binding parameter [3] as [INTEGER] - 406
2012-11-16 20:04:41,603 DEBUG [AbstractBatcher] Executing batch size: 1
2012-11-16 20:04:41,605 DEBUG [Expectations] success of batch update unknown: 0
2012-11-16 20:04:41,605 DEBUG [AbstractBatcher] about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
2012-11-16 20:04:41,605 DEBUG [AbstractBatcher] about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
2012-11-16 20:04:41,605 DEBUG [SQL]
insert
into
navbar_language
(version, language_code, navbar_id, id)
values
(?, ?, ?, ?)
Hibernate:
insert
into
navbar_language
(version, language_code, navbar_id, id)
values
(?, ?, ?, ?)
2012-11-16 20:04:41,605 TRACE [BasicBinder] binding parameter [1] as [INTEGER] - 0
2012-11-16 20:04:41,605 TRACE [BasicBinder] binding parameter [2] as [VARCHAR] - en
2012-11-16 20:04:41,605 TRACE [BasicBinder] binding parameter [3] as [INTEGER] - 406
2012-11-16 20:04:41,606 TRACE [BasicBinder] binding parameter [4] as [INTEGER] - 361
2012-11-16 20:04:41,606 DEBUG [AbstractBatcher] reusing prepared statement
2012-11-16 20:04:41,606 DEBUG [SQL]
insert
into
navbar_language
(version, language_code, navbar_id, id)
values
(?, ?, ?, ?)
Hibernate:
insert
into
navbar_language
(version, language_code, navbar_id, id)
values
(?, ?, ?, ?)
2012-11-16 20:04:41,606 TRACE [BasicBinder] binding parameter [1] as [INTEGER] - 0
2012-11-16 20:04:41,606 TRACE [BasicBinder] binding parameter [2] as [VARCHAR] - fr
2012-11-16 20:04:41,606 TRACE [BasicBinder] binding parameter [3] as [INTEGER] - 406
2012-11-16 20:04:41,606 TRACE [BasicBinder] binding parameter [4] as [INTEGER] - 362
2012-11-16 20:04:41,606 DEBUG [AbstractBatcher] reusing prepared statement
2012-11-16 20:04:41,606 DEBUG [SQL]
insert
into
navbar_language
(version, language_code, navbar_id, id)
values
(?, ?, ?, ?)
Hibernate:
insert
into
navbar_language
(version, language_code, navbar_id, id)
values
(?, ?, ?, ?)
2012-11-16 20:04:41,606 TRACE [BasicBinder] binding parameter [1] as [INTEGER] - 0
2012-11-16 20:04:41,606 TRACE [BasicBinder] binding parameter [2] as [VARCHAR] - se
2012-11-16 20:04:41,607 TRACE [BasicBinder] binding parameter [3] as [INTEGER] - 406
2012-11-16 20:04:41,607 TRACE [BasicBinder] binding parameter [4] as [INTEGER] - 363
2012-11-16 20:04:41,607 DEBUG [AbstractBatcher] Executing batch size: 3
2012-11-16 20:04:41,608 DEBUG [AbstractBatcher] about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
2012-11-16 20:04:41,609 DEBUG [JDBCExceptionReporter] Could not execute JDBC batch update [insert into navbar_language (version, language_code, navbar_id, id) values (?, ?, ?, ?)]
java.sql.BatchUpdateException: ORA-02291: integrity constraint (STEPHANE.NAVBAR_LANGUAGE_FK1) violated - parent key not found
at oracle.jdbc.driver.DatabaseError.throwBatchUpdateException(DatabaseError.java:343)
at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:10768)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:70)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:268)
at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:114)
at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:109)
at org.hibernate.jdbc.AbstractBatcher.prepareBatchStatement(AbstractBatcher.java:244)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2411)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2868)
at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:79)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:273)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:265)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:184)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
at org.hibernate.event.def.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:64)
at org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:1185)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1709)
at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:347)
at org.hibernate.impl.CriteriaImpl.uniqueResult(CriteriaImpl.java:369)
at com.thalasoft.learnintouch.core.dao.hibernate.NavbarItemHibernateDao.findNextWithListOrder(NavbarItemHibernateDao.java:74)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:319)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:155)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at $Proxy48.findNextWithListOrder(Unknown Source)
at com.thalasoft.learnintouch.core.dao.NavbarItemDaoTest.testFindNextByListOrder(NavbarItemDaoTest.java:166)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74)
at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:83)
at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:231)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71)
at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:174)
at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:53)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:123)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:104)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110)
at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:175)
at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcessWhenForked(SurefireStarter.java:107)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:68)
2012-11-16 20:04:41,610 WARN [JDBCExceptionReporter] SQL Error: 2291, SQLState: 23000
2012-11-16 20:04:41,610 ERROR [JDBCExceptionReporter] ORA-02291: integrity constraint (STEPHANE.NAVBAR_LANGUAGE_FK1) violated - parent key not found
2012-11-16 20:04:41,610 WARN [JDBCExceptionReporter] SQL Error: 2291, SQLState: 23000
2012-11-16 20:04:41,610 ERROR [JDBCExceptionReporter] ORA-02291: integrity constraint (STEPHANE.NAVBAR_LANGUAGE_FK1) violated - parent key not found
2012-11-16 20:04:41,610 DEBUG [HibernateTransactionManager] Participating transaction failed - marking existing transaction as rollback-only
2012-11-16 20:04:41,610 DEBUG [HibernateTransactionManager] Participating transaction failed - marking existing transaction as rollback-only
2012-11-16 20:04:41,610 DEBUG [HibernateTransactionManager] Setting Hibernate transaction on Session [org.hibernate.impl.SessionImpl@14079b1] rollback-only
2012-11-16 20:04:41,610 DEBUG [HibernateTransactionManager] Setting Hibernate transaction on Session [org.hibernate.impl.SessionImpl@14079b1] rollback-only
2012-11-16 20:04:41,611 DEBUG [TransactionalTestExecutionListener] No method-level @Rollback override: using default rollback [true] for test context [[TestContext@4dc992 testClass = NavbarItemDaoTest, testInstance = com.thalasoft.learnintouch.core.dao.NavbarItemDaoTest@1c76f7e, testMethod = testFindNextByListOrder@NavbarItemDaoTest, testException = org.springframework.dao.DataIntegrityViolationException: Could not execute JDBC batch update; SQL [insert into navbar_language (version, language_code, navbar_id, id) values (?, ?, ?, ?)]; constraint [STEPHANE.NAVBAR_LANGUAGE_FK1]; nested exception is org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update, mergedContextConfiguration = [MergedContextConfiguration@14b9aee testClass = NavbarItemDaoTest, locations = '{classpath:spring-hibernate.xml, classpath:spring-hibernate-dao.xml, classpath:spring-data-source.xml, classpath:log4j.xml}', classes = '{}', activeProfiles = '{}', contextLoader = 'org.springframework.test.context.support.DelegatingSmartContextLoader']]]
2012-11-16 20:04:41,611 DEBUG [TransactionalTestExecutionListener] No method-level @Rollback override: using default rollback [true] for test context [[TestContext@4dc992 testClass = NavbarItemDaoTest, testInstance = com.thalasoft.learnintouch.core.dao.NavbarItemDaoTest@1c76f7e, testMethod = testFindNextByListOrder@NavbarItemDaoTest, testException = org.springframework.dao.DataIntegrityViolationException: Could not execute JDBC batch update; SQL [insert into navbar_language (version, language_code, navbar_id, id) values (?, ?, ?, ?)]; constraint [STEPHANE.NAVBAR_LANGUAGE_FK1]; nested exception is org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update, mergedContextConfiguration = [MergedContextConfiguration@14b9aee testClass = NavbarItemDaoTest, locations = '{classpath:spring-hibernate.xml, classpath:spring-hibernate-dao.xml, classpath:spring-data-source.xml, classpath:log4j.xml}', classes = '{}', activeProfiles = '{}', contextLoader = 'org.springframework.test.context.support.DelegatingSmartContextLoader']]]
2012-11-16 20:04:41,611 DEBUG [HibernateTransactionManager] Initiating transaction rollback
2012-11-16 20:04:41,611 DEBUG [HibernateTransactionManager] Initiating transaction rollback
2012-11-16 20:04:41,611 DEBUG [HibernateTransactionManager] Rolling back Hibernate transaction on Session [org.hibernate.impl.SessionImpl@14079b1]
2012-11-16 20:04:41,611 DEBUG [HibernateTransactionManager] Rolling back Hibernate transaction on Session [org.hibernate.impl.SessionImpl@14079b1]
2012-11-16 20:04:41,611 DEBUG [JDBCTransaction] rollback
2012-11-16 20:04:41,629 DEBUG [JDBCTransaction] re-enabling autocommit
2012-11-16 20:04:41,629 DEBUG [JDBCTransaction] rolled back JDBC Connection