java.sql.BatchUpdateException: Invalid argument value, message from server: "Duplicate entry '5' for key 1"

Atlassian JIRA | Charles Miller | 1 decade ago
  1. 0

    Install server against MySQL Import confluence.atlassian.com data Try to create a space: the space is created, but you're left with a stack-trace of a primary key conflict: java.sql.BatchUpdateException: Invalid argument value, message from server: "Duplicate entry '5' for key 1" at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:1404) at net.sf.hibernate.impl.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:54) at net.sf.hibernate.impl.BatcherImpl.executeBatch(BatcherImpl.java:122) at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2385) at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2335) at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2204) at net.sf.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:61) at org.springframework.orm.hibernate.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:339) at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:302) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:174) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:196) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:135) at $Proxy10.savePermission(Unknown Source) at com.atlassian.confluence.spaces.DefaultSpaceManager.createSpace(DefaultSpaceManager.java:168) 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:324) at org.springframework.aop.framework.AopProxyUtils.invokeJoinpointUsingReflection(AopProxyUtils.java:59) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:201) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176) at com.atlassian.confluence.util.profiling.SpringProfilingInterceptor.invoke(SpringProfilingInterceptor.java:17) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:196) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:135) at $Proxy12.createSpace(Unknown Source) Try to follow that with a SnipSnap import, it also fails with PK problems: org.springframework.orm.hibernate.HibernateSystemException: a different object with the same identifier value was already associated with the session: 3, of class: com.opensymphony.user.provider.hibernate.entity.HibernateUser; nested exception is net.sf.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: 3, of class: com.opensymphony.user.provider.hibernate.entity.HibernateUser net.sf.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: 3, of class: com.opensymphony.user.provider.hibernate.entity.HibernateUser at net.sf.hibernate.impl.SessionImpl.doSave(SessionImpl.java:823) at net.sf.hibernate.impl.SessionImpl.saveWithGeneratedIdentifier(SessionImpl.java:761) at net.sf.hibernate.impl.SessionImpl.save(SessionImpl.java:720) at org.springframework.orm.hibernate.HibernateTemplate$7.doInHibernate(HibernateTemplate.java:299) at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:149) at org.springframework.orm.hibernate.HibernateTemplate.save(HibernateTemplate.java:297) at com.atlassian.confluence.user.persistence.dao.hibernate.ConfluenceUserDAO.saveUser(ConfluenceUserDAO.java:176) at com.opensymphony.user.provider.hibernate.HibernateCredentialsProvider.create(HibernateCredentialsProvider.java:64) at com.atlassian.confluence.user.providers.ConfluenceCredentialsProvider.create(ConfluenceCredentialsProvider.java:60) at com.opensymphony.user.UserManager.createEntity(UserManager.java:370) at com.opensymphony.user.UserManager.createUser(UserManager.java:242)

    Atlassian JIRA | 1 decade ago | Charles Miller
    java.sql.BatchUpdateException: Invalid argument value, message from server: "Duplicate entry '5' for key 1"
  2. 0

    Install server against MySQL Import confluence.atlassian.com data Try to create a space: the space is created, but you're left with a stack-trace of a primary key conflict: java.sql.BatchUpdateException: Invalid argument value, message from server: "Duplicate entry '5' for key 1" at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:1404) at net.sf.hibernate.impl.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:54) at net.sf.hibernate.impl.BatcherImpl.executeBatch(BatcherImpl.java:122) at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2385) at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2335) at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2204) at net.sf.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:61) at org.springframework.orm.hibernate.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:339) at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:302) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:174) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:196) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:135) at $Proxy10.savePermission(Unknown Source) at com.atlassian.confluence.spaces.DefaultSpaceManager.createSpace(DefaultSpaceManager.java:168) 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:324) at org.springframework.aop.framework.AopProxyUtils.invokeJoinpointUsingReflection(AopProxyUtils.java:59) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:201) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176) at com.atlassian.confluence.util.profiling.SpringProfilingInterceptor.invoke(SpringProfilingInterceptor.java:17) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:196) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:135) at $Proxy12.createSpace(Unknown Source) Try to follow that with a SnipSnap import, it also fails with PK problems: org.springframework.orm.hibernate.HibernateSystemException: a different object with the same identifier value was already associated with the session: 3, of class: com.opensymphony.user.provider.hibernate.entity.HibernateUser; nested exception is net.sf.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: 3, of class: com.opensymphony.user.provider.hibernate.entity.HibernateUser net.sf.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: 3, of class: com.opensymphony.user.provider.hibernate.entity.HibernateUser at net.sf.hibernate.impl.SessionImpl.doSave(SessionImpl.java:823) at net.sf.hibernate.impl.SessionImpl.saveWithGeneratedIdentifier(SessionImpl.java:761) at net.sf.hibernate.impl.SessionImpl.save(SessionImpl.java:720) at org.springframework.orm.hibernate.HibernateTemplate$7.doInHibernate(HibernateTemplate.java:299) at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:149) at org.springframework.orm.hibernate.HibernateTemplate.save(HibernateTemplate.java:297) at com.atlassian.confluence.user.persistence.dao.hibernate.ConfluenceUserDAO.saveUser(ConfluenceUserDAO.java:176) at com.opensymphony.user.provider.hibernate.HibernateCredentialsProvider.create(HibernateCredentialsProvider.java:64) at com.atlassian.confluence.user.providers.ConfluenceCredentialsProvider.create(ConfluenceCredentialsProvider.java:60) at com.opensymphony.user.UserManager.createEntity(UserManager.java:370) at com.opensymphony.user.UserManager.createUser(UserManager.java:242)

    Atlassian JIRA | 1 decade ago | Charles Miller
    java.sql.BatchUpdateException: Invalid argument value, message from server: "Duplicate entry '5' for key 1"
  3. 0

    DataIntegrity Exception with Multiple Web Application Containers and 1 Database

    Stack Overflow | 6 years ago | Melissa W
    java.sql.BatchUpdateException: null, message from server: "Duplicate entry '56' for key 'PRIMARY'"
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Data too long for column in hibernate?

    Stack Overflow | 1 year ago | PythonNewHand
    org.hibernate.exception.DataException: Could not execute JDBC batch update
  6. 0

    Truncate offline cause

    GitHub | 3 years ago | cbos
    java.lang.RuntimeException: javax.persistence.PersistenceException: org.hibernate.exception.DataException: Could not execute JDBC batch update

  1. linxiaolong 36 times, last 5 days ago
  2. linxiaolong 4 times, last 4 months ago
  3. mortalman7 32 times, last 5 months ago
9 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

    Invalid argument value, message from server: "Duplicate entry '5' for key 1"

    at com.mysql.jdbc.PreparedStatement.executeBatch()
  2. MySQL jdbc
    PreparedStatement.executeBatch
    1. com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:1404)
    1 frame
  3. net.sf.hibernate
    JDBCTransaction.commit
    1. net.sf.hibernate.impl.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:54)
    2. net.sf.hibernate.impl.BatcherImpl.executeBatch(BatcherImpl.java:122)
    3. net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2385)
    4. net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2335)
    5. net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2204)
    6. net.sf.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:61)
    6 frames
  4. Hibernate
    HibernateTransactionManager.doCommit
    1. org.springframework.orm.hibernate.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:339)
    1 frame
  5. Spring Tx
    TransactionInterceptor.invoke
    1. org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:302)
    2. org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:174)
    2 frames
  6. Spring AOP
    JdkDynamicAopProxy.invoke
    1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:196)
    2. org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:135)
    2 frames
  7. Unknown
    $Proxy10.savePermission
    1. $Proxy10.savePermission(Unknown Source)
    1 frame
  8. com.atlassian.confluence
    DefaultSpaceManager.createSpace
    1. com.atlassian.confluence.spaces.DefaultSpaceManager.createSpace(DefaultSpaceManager.java:168)
    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:324)
    4 frames
  10. Spring AOP
    ReflectiveMethodInvocation.proceed
    1. org.springframework.aop.framework.AopProxyUtils.invokeJoinpointUsingReflection(AopProxyUtils.java:59)
    2. org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:201)
    3. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176)
    3 frames
  11. com.atlassian.confluence
    SpringProfilingInterceptor.invoke
    1. com.atlassian.confluence.util.profiling.SpringProfilingInterceptor.invoke(SpringProfilingInterceptor.java:17)
    1 frame
  12. Spring AOP
    JdkDynamicAopProxy.invoke
    1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:196)
    2. org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:135)
    2 frames
  13. Unknown
    $Proxy12.createSpace
    1. $Proxy12.createSpace(Unknown Source)
    1 frame