javax.persistence.PersistenceException: org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update

Stack Overflow | giulius | 6 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    Transaction and Rollback in Spring with JPA

    Stack Overflow | 6 years ago | giulius
    javax.persistence.PersistenceException: org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
  2. 0

    Hibernate Community • View topic - java.sql.BatchUpdateException:

    hibernate.org | 2 years ago
    org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
  3. 0

    Hibernate Community • View topic - java.sql.BatchUpdateException:

    hibernate.org | 8 months ago
    org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    jpa persisting entity with manytoone relationship and inserting null instead of id

    Stack Overflow | 3 years ago | Vamekh Goiati
    javax.persistence.RollbackException: Error while committing the transaction
  6. 0

    ORA-00001: unique constraint (SCOTT.IX_8D83D0CE) violated - Forums | Liferay

    liferay.com | 1 year ago
    com.liferay.portal.kernel.portlet.PortletContainerException: com.liferay.portal.kernel.portlet.PortletContainerException: com.liferay.portal.kernel.exception.SystemException: com.liferay.portal.kernel.dao.orm.ORMException: org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update

  1. treefolk 2 times, last 5 months ago
  2. r1chjames 10 times, last 11 months ago
12 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.sql.BatchUpdateException

    ORA-00001: violata restrizione di unicità (FLUSSIBATCH.SYS_C008896) and my configuration files are (persistence.xml and applicationContext.xml): This is the applicationContext.xml: ... <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalEntityManagerFactoryBean"> <property name="persistenceUnitName" value="fb-persistence" /> </bean> <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager"> <property name="entityManagerFactory" ref="entityManagerFactory"/> </bean> <tx:annotation-driven transaction-manager="transactionManager"/> <bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" /> <bean name="serviceDaoImpl" class="it.synclab.fb.jpa.dao.impl.ServiceDaoImpl" /> ... This is the persistence.xml: <persistence> <persistence-unit name="fb-persistence" transaction-type="RESOURCE_LOCAL"> <provider>org.hibernate.ejb.HibernatePersistence</provider> <mapping-file>META-INF/orm.xml</mapping-file> <class>it.entity.Service</class> <exclude-unlisted-classes>true</exclude-unlisted-classes> <properties> <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/> <property name="hibernate.connection.driver_class" value="oracle.jdbc.driver.OracleDriver"/> <property name="hibernate.show_sql" value="true"/> <property name="hibernate.connection.username" value="############"/> <property name="hibernate.connection.password" value="############"/> <property name="hibernate.connection.url" value="jdbc:oracle:thin:@localhost:1521:XE"/> </properties> </persistence-unit> </persistence>

    at oracle.jdbc.driver.DatabaseError.throwBatchUpdateException()
  2. Oracle jdbc
    OracleStatementWrapper.executeBatch
    1. oracle.jdbc.driver.DatabaseError.throwBatchUpdateException(DatabaseError.java:629)
    2. oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:9467)
    3. oracle.jdbc.driver.OracleStatementWrapper.executeBatch(OracleStatementWrapper.java:211)
    3 frames
  3. Hibernate
    ActionQueue.executeActions
    1. org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:70)
    2. org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:268)
    3. org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:268)
    4. org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:184)
    4 frames
  4. Hibernate
    SessionImpl.flush
    1. org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
    2. org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:51)
    3. org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1216)
    3 frames
  5. Hibernate EJB
    AbstractEntityManagerImpl.flush
    1. org.hibernate.ejb.AbstractEntityManagerImpl.flush(AbstractEntityManagerImpl.java:795)
    1 frame
  6. Java RT
    Method.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    4. java.lang.reflect.Method.invoke(Method.java:597)
    4 frames
  7. Spring ORM
    SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke
    1. org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:240)
    1 frame
  8. Unknown
    $Proxy27.flush
    1. $Proxy27.flush(Unknown Source)
    1 frame
  9. it.synclab.fb
    EnteDaoImpl.write
    1. it.synclab.fb.jpa.dao.impl.GenericDaoImpl.write(GenericDaoImpl.java:236)
    2. it.synclab.fb.jpa.dao.impl.EnteDaoImpl.write(EnteDaoImpl.java:1)
    2 frames
  10. Java RT
    Method.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    4. java.lang.reflect.Method.invoke(Method.java:597)
    4 frames
  11. Spring AOP
    ReflectiveMethodInvocation.proceed
    1. org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
    2. org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
    3. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
    3 frames
  12. Spring Tx
    TransactionInterceptor.invoke
    1. org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
    1 frame
  13. Spring AOP
    JdkDynamicAopProxy.invoke
    1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    2. org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
    2 frames
  14. Unknown
    $Proxy34.write
    1. $Proxy34.write(Unknown Source)
    1 frame
  15. it.synclab.fb
    ConfigTest.main
    1. it.synclab.fb.jpa.test.ConfigTest.insertEnte(ConfigTest.java:47)
    2. it.synclab.fb.jpa.test.ConfigTest.main(ConfigTest.java:32)
    2 frames