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

Atlassian JIRA | Michael Heemskerk | 5 years ago
  1. 0

    [CRUC-5920] ConstraintViolationException: Duplicate entry 'xyz' for key 'cru_user_name' after upgrading to 2.7 - Atlassian JIRA

    atlassian.com | 12 months ago
    org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
  2. 0

    After upgrading to FECRU 2.7, the following error occurs: {noformat} org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:96) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66) at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:275) 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:2395) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2858) at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:79) at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:267) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:259) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:178) 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:1175) at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1251) at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102) at org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:859) at com.atlassian.fecru.user.UserDAOImpl.getByUsername(UserDAOImpl.java:89) at com.cenqua.fisheye.user.DefaultUserManager$23.doInTransaction(DefaultUserManager.java:1415) at com.atlassian.fisheye.spi.impl.DefaultTxTemplate.execute(DefaultTxTemplate.java:123) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:80) at com.cenqua.crucible.hibernate.WithSessionAspect.doCloseSession(WithSessionAspect.java:37) at sun.reflect.GeneratedMethodAccessor47.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621) at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610) at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:65) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161) at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) at $Proxy19.execute(Unknown Source) at com.cenqua.fisheye.user.DefaultUserManager.setCrucibleEnabled(DefaultUserManager.java:1413) at com.cenqua.fisheye.user.DefaultUserManager$18.write(DefaultUserManager.java:1152) at com.cenqua.fisheye.user.DefaultUserManager$18.write(DefaultUserManager.java:1110) at com.cenqua.fisheye.config.DB0Handle.write(DB0Handle.java:96) at com.cenqua.fisheye.user.DefaultUserManager.addUserImpl(DefaultUserManager.java:1110) at com.cenqua.fisheye.user.DefaultUserManager.importUser(DefaultUserManager.java:554) at com.cenqua.fisheye.user.DefaultUserManager.getOrImportUser(DefaultUserManager.java:534) {noformat} As a result of this error, some users cannot log in anymore. In other cases, a user cannot be created. The problem is that in 2.7, no new user with the same name as a previously deleted user can be created. This applies not only to new users, but also to users that are automatically imported from Crowd or LDAP.

    Atlassian JIRA | 5 years ago | Michael Heemskerk
    org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
  3. 0

    After upgrading to FECRU 2.7, the following error occurs: {noformat} org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:96) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66) at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:275) 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:2395) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2858) at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:79) at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:267) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:259) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:178) 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:1175) at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1251) at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102) at org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:859) at com.atlassian.fecru.user.UserDAOImpl.getByUsername(UserDAOImpl.java:89) at com.cenqua.fisheye.user.DefaultUserManager$23.doInTransaction(DefaultUserManager.java:1415) at com.atlassian.fisheye.spi.impl.DefaultTxTemplate.execute(DefaultTxTemplate.java:123) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:80) at com.cenqua.crucible.hibernate.WithSessionAspect.doCloseSession(WithSessionAspect.java:37) at sun.reflect.GeneratedMethodAccessor47.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621) at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610) at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:65) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161) at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) at $Proxy19.execute(Unknown Source) at com.cenqua.fisheye.user.DefaultUserManager.setCrucibleEnabled(DefaultUserManager.java:1413) at com.cenqua.fisheye.user.DefaultUserManager$18.write(DefaultUserManager.java:1152) at com.cenqua.fisheye.user.DefaultUserManager$18.write(DefaultUserManager.java:1110) at com.cenqua.fisheye.config.DB0Handle.write(DB0Handle.java:96) at com.cenqua.fisheye.user.DefaultUserManager.addUserImpl(DefaultUserManager.java:1110) at com.cenqua.fisheye.user.DefaultUserManager.importUser(DefaultUserManager.java:554) at com.cenqua.fisheye.user.DefaultUserManager.getOrImportUser(DefaultUserManager.java:534) {noformat} As a result of this error, some users cannot log in anymore. In other cases, a user cannot be created. The problem is that in 2.7, no new user with the same name as a previously deleted user can be created. This applies not only to new users, but also to users that are automatically imported from Crowd or LDAP.

    Atlassian JIRA | 5 years ago | Michael Heemskerk
    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

    Hibernate autoincrement in loadbalancing tomcats?

    Stack Overflow | 4 years ago | Rocko
    org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
  6. 0

    ConstraintViolationException not showing constraint name MySQL

    Stack Overflow | 4 years ago | Parthiv Dixit
    org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update

    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. org.hibernate.exception.ConstraintViolationException

      Could not execute JDBC batch update

      at org.hibernate.exception.SQLStateConverter.convert()
    2. Hibernate
      AbstractEntityPersister.insert
      1. org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:96)
      2. org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
      3. org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:275)
      4. org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:114)
      5. org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:109)
      6. org.hibernate.jdbc.AbstractBatcher.prepareBatchStatement(AbstractBatcher.java:244)
      7. org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2395)
      8. org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2858)
      8 frames
    3. Hibernate
      EntityInsertAction.execute
      1. org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:79)
      1 frame
    4. Hibernate
      ActionQueue.executeActions
      1. org.hibernate.engine.ActionQueue.execute(ActionQueue.java:267)
      2. org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:259)
      3. org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:178)
      3 frames
    5. Hibernate
      AbstractQueryImpl.uniqueResult
      1. org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
      2. org.hibernate.event.def.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:64)
      3. org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:1175)
      4. org.hibernate.impl.SessionImpl.list(SessionImpl.java:1251)
      5. org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
      6. org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:859)
      6 frames
    6. com.atlassian.fecru
      UserDAOImpl.getByUsername
      1. com.atlassian.fecru.user.UserDAOImpl.getByUsername(UserDAOImpl.java:89)
      1 frame
    7. com.cenqua.fisheye
      DefaultUserManager$23.doInTransaction
      1. com.cenqua.fisheye.user.DefaultUserManager$23.doInTransaction(DefaultUserManager.java:1415)
      1 frame
    8. com.atlassian.fisheye
      DefaultTxTemplate.execute
      1. com.atlassian.fisheye.spi.impl.DefaultTxTemplate.execute(DefaultTxTemplate.java:123)
      1 frame
    9. 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
    10. Spring AOP
      MethodInvocationProceedingJoinPoint.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)
      4. org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:80)
      4 frames
    11. com.cenqua.crucible
      WithSessionAspect.doCloseSession
      1. com.cenqua.crucible.hibernate.WithSessionAspect.doCloseSession(WithSessionAspect.java:37)
      1 frame
    12. Java RT
      Method.invoke
      1. sun.reflect.GeneratedMethodAccessor47.invoke(Unknown Source)
      2. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      3. java.lang.reflect.Method.invoke(Method.java:597)
      3 frames
    13. Spring AOP
      JdkDynamicAopProxy.invoke
      1. org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621)
      2. org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610)
      3. org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:65)
      4. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
      5. org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
      6. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
      7. org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
      7 frames
    14. Unknown
      $Proxy19.execute
      1. $Proxy19.execute(Unknown Source)
      1 frame
    15. com.cenqua.fisheye
      DefaultUserManager.getOrImportUser
      1. com.cenqua.fisheye.user.DefaultUserManager.setCrucibleEnabled(DefaultUserManager.java:1413)
      2. com.cenqua.fisheye.user.DefaultUserManager$18.write(DefaultUserManager.java:1152)
      3. com.cenqua.fisheye.user.DefaultUserManager$18.write(DefaultUserManager.java:1110)
      4. com.cenqua.fisheye.config.DB0Handle.write(DB0Handle.java:96)
      5. com.cenqua.fisheye.user.DefaultUserManager.addUserImpl(DefaultUserManager.java:1110)
      6. com.cenqua.fisheye.user.DefaultUserManager.importUser(DefaultUserManager.java:554)
      7. com.cenqua.fisheye.user.DefaultUserManager.getOrImportUser(DefaultUserManager.java:534)
      7 frames