org.springframework.dao.DataIntegrityViolationException

could not perform addBatch; SQL [insert into cwd_user (user_name, lower_user_name, is_active, created_date, updated_date, first_name, lower_first_name, last_name, lower_last_name, display_name, lower_display_name, email_address, lower_email_address, external_id, directory_id, credential, id) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]; constraint [null]; nested exception is org.hibernate.exception.ConstraintViolationException: could not perform addBatch

Samebug tips0

There are no available Samebug tips for this exception. If you know how to solve this issue, help other users by writing a short tip.

Don't give up yet. Paste your full stack trace to get a solution.

Solutions on the web527

  • via Atlassian JIRA by Jason Hinch [Atlassian], 11 months ago
    could not perform addBatch; SQL [insert into cwd_user (user_name, lower_user_name, is_active, created_date, updated_date, first_name, lower_first_name, last_name, lower_last_name, display_name, lower_display_name, email_address, lower_email_address
  • via Atlassian JIRA by Jason Hinch, 1 year ago
    could not perform addBatch; SQL [insert into cwd_user (user_name, lower_user_name, is_active, created_date, updated_date, first_name, lower_first_name, last_name, lower_last_name, display_name, lower_display_name, email_address, lower_email_address
  • could not perform addBatch; SQL [insert into cwd_user (user_name, lower_user_name, is_active, created_date, updated_date, first_name, lower_first_name, last_name, lower_last_name, display_name, lower_display_name, email_address, lower_email_address
  • Stack trace

    • org.springframework.dao.DataIntegrityViolationException: could not perform addBatch; SQL [insert into cwd_user (user_name, lower_user_name, is_active, created_date, updated_date, first_name, lower_first_name, last_name, lower_last_name, display_name, lower_display_name, email_address, lower_email_address, external_id, directory_id, credential, id) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]; constraint [null]; nested exception is org.hibernate.exception.ConstraintViolationException: could not perform addBatch at org.springframework.orm.hibernate4.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:138)[spring-orm-3.2.4.RELEASE.jar:3.2.4.RELEASE] at org.springframework.orm.hibernate4.HibernateTransactionManager.convertHibernateAccessException(HibernateTransactionManager.java:680)[spring-orm-3.2.4.RELEASE.jar:3.2.4.RELEASE] at org.springframework.orm.hibernate4.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:562)[spring-orm-3.2.4.RELEASE.jar:3.2.4.RELEASE] at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:755)[spring-tx-3.2.4.RELEASE.jar:3.2.4.RELEASE] at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:724)[spring-tx-3.2.4.RELEASE.jar:3.2.4.RELEASE] at com.atlassian.stash.internal.crowd.SpringBatchTransactionSupplier.doCommit(SpringBatchTransactionSupplier.java:48)[stash-dao-impl-2.9.0-SNAPSHOT.jar:na] at com.atlassian.stash.internal.crowd.SpringBatchTransactionSupplier.access$100(SpringBatchTransactionSupplier.java:24)[stash-dao-impl-2.9.0-SNAPSHOT.jar:na] at com.atlassian.stash.internal.crowd.SpringBatchTransactionSupplier$SynchronizationBatchTransaction.commit(SpringBatchTransactionSupplier.java:90)[stash-dao-impl-2.9.0-SNAPSHOT.jar:na] at com.atlassian.stash.internal.crowd.TransactionManagerBatchProcessor.commitTransaction(TransactionManagerBatchProcessor.java:82)[stash-dao-impl-2.9.0-SNAPSHOT.jar:na] at com.atlassian.stash.internal.crowd.TransactionManagerBatchProcessor.afterProcessBatch(TransactionManagerBatchProcessor.java:32)[stash-dao-impl-2.9.0-SNAPSHOT.jar:na] at com.atlassian.crowd.util.persistence.hibernate.batch.AbstractBatchProcessor.processBatch(AbstractBatchProcessor.java:160)[crowd-persistence-2.7.1-m1.jar:na] at com.atlassian.crowd.util.persistence.hibernate.batch.AbstractBatchProcessor.execute(AbstractBatchProcessor.java:133)[crowd-persistence-2.7.1-m1.jar:na] at com.atlassian.crowd.dao.user.UserDAOHibernate.addAll(UserDAOHibernate.java:115)[crowd-persistence-hibernate4-2.7.1-m1.jar:na] at com.atlassian.stash.internal.crowd.HibernateUserDao.addAll(HibernateUserDao.java:80)[stash-dao-impl-2.9.0-SNAPSHOT.jar:na] at com.atlassian.crowd.directory.CachingDirectory.addAllUsers(CachingDirectory.java:97)[crowd-persistence-2.7.1-m1.jar:na] at com.atlassian.crowd.directory.DbCachingRemoteChangeOperations.addUsers(DbCachingRemoteChangeOperations.java:178)[crowd-core-2.7.1-m1.jar:na] at com.atlassian.crowd.directory.$Proxy1544.addUsers(Unknown Source)[na:na] at com.atlassian.crowd.directory.DirectoryCacheImplUsingChangeOperations.addOrUpdateCachedUsers(DirectoryCacheImplUsingChangeOperations.java:58)[crowd-core-2.7.1-m1.jar:na] at com.atlassian.crowd.directory.ldap.cache.RemoteDirectoryCacheRefresher.synchroniseAllUsers(RemoteDirectoryCacheRefresher.java:68)[crowd-ldap-2.7.1-m1.jar:na] at com.atlassian.crowd.directory.ldap.cache.AbstractCacheRefresher.synchroniseAll(AbstractCacheRefresher.java:78)[crowd-ldap-2.7.1-m1.jar:na] at com.atlassian.crowd.directory.ldap.cache.EventTokenChangedCacheRefresher.synchroniseAll(EventTokenChangedCacheRefresher.java:71)[crowd-ldap-2.7.1-m1.jar:na] at com.atlassian.crowd.directory.DbCachingRemoteDirectory.synchroniseCache(DbCachingRemoteDirectory.java:998)[crowd-core-2.7.1-m1.jar:na] at com.atlassian.crowd.manager.directory.DirectorySynchroniserImpl.synchronise(DirectorySynchroniserImpl.java:75)[crowd-core-2.7.1-m1.jar:na] at com.atlassian.crowd.directory.DbCachingDirectoryPoller.pollChanges(DbCachingDirectoryPoller.java:50)[crowd-core-2.7.1-m1.jar:na] at com.atlassian.crowd.manager.directory.monitor.poller.DirectoryPollerJobBean.executeInternal(DirectoryPollerJobBean.java:29)[crowd-core-2.7.1-m1.jar:na] at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:113)[spring-context-support-3.2.4.RELEASE.jar:3.2.4.RELEASE] at org.quartz.core.JobRunShell.run(JobRunShell.java:223)[quartz-1.8.6.jar:na] at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549)[quartz-1.8.6.jar:na]

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    Unknown user
    Once, 10 months ago
    Unknown user
    Once, 1 year ago
    Unknown user
    Once, 1 year ago
    Unknown user
    Once, 1 year ago