org.hibernate.exception.ConstraintViolationException: could not perform addBatch 2013-08-28 02:47:14.965515500 at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:129) 2013-08-28 02:47:14.965516500 at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49) 2013-08-28 02:47:14.965519500 at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:125) 2013-08-28 02:47:14.965519500 at org.hibernate.engine.jdbc.batch.internal.BatchingBatch.performExecution(BatchingBatch.java:114)

Atlassian JIRA | Robert Massaioli | 3 years ago
  1. 0

    [CWD-3568] Multiple REST calls at the same time has cwd_token race condition. - Atlassian JIRA

    atlassian.com | 1 year ago
    org.hibernate.exception.ConstraintViolationException: could not perform addBatch 2013-08-28 02:47:14.965515500 at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:129) 2013-08-28 02:47:14.965516500 at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49) 2013-08-28 02:47:14.965519500 at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:125) 2013-08-28 02:47:14.965519500 at org.hibernate.engine.jdbc.batch.internal.BatchingBatch.performExecution(BatchingBatch.java:114)
  2. 0

    If you look at these logs you can see that Crowd has a race condition if multiple REST calls attempt to create multiple tokens at the same time: {noformat} 2013-08-28 02:47:14.952800500 2013-08-28 02:47:14,950 TP-Processor7 WARN [engine.jdbc.spi.SqlExceptionHelper] SQL Error: 0, SQLState: 23505 2013-08-28 02:47:14.952801500 2013-08-28 02:47:14,950 TP-Processor7 ERROR [engine.jdbc.spi.SqlExceptionHelper] Batch entry 0 insert into cwd_token (directory_id, entity_name, random_number, identifier_hash, random_hash, created_date, last_accessed_date, last_accessed_time, duration, id) values ('-1', 'jira', '8655037538040444656', 'hVtW5FElx8qNjHjM06Kw8A00', '9uSHM0TywIF3CK0uhJV5Ow00', '2013-08-28 02:47:14.691000 +00:00:00', '2013-08-28 02:47:14.691000 +00:00:00', '1377658034691', NULL, '491523') was aborted. Call getNextException to see the cause. 2013-08-28 02:47:14.952816500 2013-08-28 02:47:14,950 TP-Processor7 WARN [engine.jdbc.spi.SqlExceptionHelper] SQL Error: 0, SQLState: 23505 2013-08-28 02:47:14.952817500 2013-08-28 02:47:14,950 TP-Processor7 ERROR [engine.jdbc.spi.SqlExceptionHelper] ERROR: duplicate key value violates unique constraint "cwd_token_identifier_hash_key" 2013-08-28 02:47:14.952818500 2013-08-28 02:47:14,951 TP-Processor7 ERROR [jdbc.batch.internal.BatchingBatch] HHH000315: Exception executing batch [could not perform addBatch] 2013-08-28 02:47:14.956453500 2013-08-28 02:47:14,952 TP-Processor1 WARN [engine.jdbc.spi.SqlExceptionHelper] SQL Error: 0, SQLState: 23505 2013-08-28 02:47:14.956455500 2013-08-28 02:47:14,956 TP-Processor1 ERROR [engine.jdbc.spi.SqlExceptionHelper] Batch entry 0 insert into cwd_token (directory_id, entity_name, random_number, identifier_hash, random_hash, created_date, last_accessed_date, last_accessed_time, duration, id) values ('-1', 'jira', '9043271484788623239', 'hVtW5FElx8qNjHjM06Kw8A00', 'oaDMcq1gFxaNbljtKKp0Bg00', '2013-08-28 02:47:14.702000 +00:00:00', '2013-08-28 02:47:14.702000 +00:00:00', '1377658034702', NULL, '491524') was aborted. Call getNextException to see the cause. 2013-08-28 02:47:14.956469500 2013-08-28 02:47:14,956 TP-Processor1 WARN [engine.jdbc.spi.SqlExceptionHelper] SQL Error: 0, SQLState: 23505 2013-08-28 02:47:14.956477500 2013-08-28 02:47:14,956 TP-Processor1 ERROR [engine.jdbc.spi.SqlExceptionHelper] ERROR: duplicate key value violates unique constraint "cwd_token_identifier_hash_key" 2013-08-28 02:47:14.965455500 2013-08-28 02:47:14,952 TP-Processor2 WARN [engine.jdbc.spi.SqlExceptionHelper] SQL Error: 0, SQLState: 23505 2013-08-28 02:47:14.965456500 2013-08-28 02:47:14,957 TP-Processor2 ERROR [engine.jdbc.spi.SqlExceptionHelper] Batch entry 0 insert into cwd_token (directory_id, entity_name, random_number, identifier_hash, random_hash, created_date, last_accessed_date, last_accessed_time, duration, id) values ('-1', 'jira', '510701224900085190', 'hVtW5FElx8qNjHjM06Kw8A00', 'imnuLQK84Vunu2kkNXvWwg00', '2013-08-28 02:47:14.719000 +00:00:00', '2013-08-28 02:47:14.719000 +00:00:00', '1377658034719', NULL, '491525') was aborted. Call getNextException to see the cause. 2013-08-28 02:47:14.965465500 2013-08-28 02:47:14,957 TP-Processor2 WARN [engine.jdbc.spi.SqlExceptionHelper] SQL Error: 0, SQLState: 23505 2013-08-28 02:47:14.965466500 2013-08-28 02:47:14,957 TP-Processor2 ERROR [engine.jdbc.spi.SqlExceptionHelper] ERROR: duplicate key value violates unique constraint "cwd_token_identifier_hash_key" 2013-08-28 02:47:14.965467500 2013-08-28 02:47:14,957 TP-Processor2 ERROR [jdbc.batch.internal.BatchingBatch] HHH000315: Exception executing batch [could not perform addBatch] 2013-08-28 02:47:14.965470500 Aug 28, 2013 2:47:14 AM org.apache.catalina.core.StandardWrapperValve invoke 2013-08-28 02:47:14.965470500 SEVERE: Servlet.service() for servlet jersey-servlet threw exception 2013-08-28 02:47:14.965471500 org.springframework.dao.DataIntegrityViolationException: could not perform addBatch; SQL [insert into cwd_token (directory_id, entity_name, random_number, identifier_hash, random_hash, created_date, last_accessed_date, last_accessed_time, duration, id) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]; constraint [null]; nested exception is org.hibernate.exception.ConstraintViolationException: could not perform addBatch 2013-08-28 02:47:14.965474500 at org.springframework.orm.hibernate4.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:138) 2013-08-28 02:47:14.965475500 at org.springframework.orm.hibernate4.HibernateTransactionManager.convertHibernateAccessException(HibernateTransactionManager.java:680) 2013-08-28 02:47:14.965476500 at org.springframework.orm.hibernate4.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:562) 2013-08-28 02:47:14.965476500 at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:755) 2013-08-28 02:47:14.965479500 at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:724) 2013-08-28 02:47:14.965480500 at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:475) 2013-08-28 02:47:14.965481500 at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:270) 2013-08-28 02:47:14.965486500 at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94) 2013-08-28 02:47:14.965486500 at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) 2013-08-28 02:47:14.965487500 at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) 2013-08-28 02:47:14.965488500 at $Proxy22.authenticateApplication(Unknown Source) 2013-08-28 02:47:14.965489500 at com.atlassian.crowd.plugin.rest.filter.BasicApplicationAuthenticationFilter.authenticate(BasicApplicationAuthenticationFilter.java:132) 2013-08-28 02:47:14.965489500 at com.atlassian.crowd.plugin.rest.filter.BasicApplicationAuthenticationFilter.doFilter(BasicApplicationAuthenticationFilter.java:86) 2013-08-28 02:47:14.965492500 at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343) 2013-08-28 02:47:14.965493500 at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260) 2013-08-28 02:47:14.965494500 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) 2013-08-28 02:47:14.965495500 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 2013-08-28 02:47:14.965495500 at com.atlassian.crowd.horde.filters.SysadminPasswordExpiryServletFilter.doFilter(SysadminPasswordExpiryServletFilter.java:42) 2013-08-28 02:47:14.965496500 at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343) 2013-08-28 02:47:14.965498500 at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260) 2013-08-28 02:47:14.965498500 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) 2013-08-28 02:47:14.965499500 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 2013-08-28 02:47:14.965499500 at org.springframework.orm.hibernate4.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:152) 2013-08-28 02:47:14.965502500 at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) 2013-08-28 02:47:14.965502500 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) 2013-08-28 02:47:14.965503500 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 2013-08-28 02:47:14.965504500 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) 2013-08-28 02:47:14.965505500 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) 2013-08-28 02:47:14.965506500 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) 2013-08-28 02:47:14.965506500 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) 2013-08-28 02:47:14.965507500 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) 2013-08-28 02:47:14.965508500 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) 2013-08-28 02:47:14.965508500 at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190) 2013-08-28 02:47:14.965509500 at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:291) 2013-08-28 02:47:14.965511500 at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:776) 2013-08-28 02:47:14.965512500 at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:705) 2013-08-28 02:47:14.965512500 at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:898) 2013-08-28 02:47:14.965513500 at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690) 2013-08-28 02:47:14.965514500 at java.lang.Thread.run(Thread.java:662) 2013-08-28 02:47:14.965514500 Caused by: org.hibernate.exception.ConstraintViolationException: could not perform addBatch 2013-08-28 02:47:14.965515500 at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:129) 2013-08-28 02:47:14.965516500 at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49) 2013-08-28 02:47:14.965519500 at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:125) 2013-08-28 02:47:14.965519500 at org.hibernate.engine.jdbc.batch.internal.BatchingBatch.performExecution(BatchingBatch.java:114) 2013-08-28 02:47:14.965520500 at org.hibernate.engine.jdbc.batch.internal.BatchingBatch.doExecuteBatch(BatchingBatch.java:101) 2013-08-28 02:47:14.965520500 at org.hibernate.engine.jdbc.batch.internal.AbstractBatchImpl.execute(AbstractBatchImpl.java:149) 2013-08-28 02:47:14.965523500 at org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl.executeBatch(JdbcCoordinatorImpl.java:198) 2013-08-28 02:47:14.965523500 at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:372) 2013-08-28 02:47:14.965524500 at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:286) 2013-08-28 02:47:14.965524500 at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:339) 2013-08-28 02:47:14.965526500 at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:52) 2013-08-28 02:47:14.965526500 at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1234) 2013-08-28 02:47:14.965527500 at org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:404) 2013-08-28 02:47:14.965527500 at org.hibernate.engine.transaction.internal.jdbc.JdbcTransaction.beforeTransactionCommit(JdbcTransaction.java:101) 2013-08-28 02:47:14.965529500 at org.hibernate.engine.transaction.spi.AbstractTransactionImpl.commit(AbstractTransactionImpl.java:175) 2013-08-28 02:47:14.965529500 at org.springframework.orm.hibernate4.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:554) 2013-08-28 02:47:14.965533500 ... 36 more 2013-08-28 02:47:14.965533500 Caused by: java.sql.BatchUpdateException: Batch entry 0 insert into cwd_token (directory_id, entity_name, random_number, identifier_hash, random_hash, created_date, last_accessed_date, last_accessed_time, duration, id) values ('-1', 'jira', '510701224900085190', 'hVtW5FElx8qNjHjM06Kw8A00', 'imnuLQK84Vunu2kkNXvWwg00', '2013-08-28 02:47:14.719000 +00:00:00', '2013-08-28 02:47:14.719000 +00:00:00', '1377658034719', NULL, '491525') was aborted. Call getNextException to see the cause. 2013-08-28 02:47:14.965536500 at org.postgresql.jdbc2.AbstractJdbc2Statement$BatchResultHandler.handleError(AbstractJdbc2Statement.java:2586) 2013-08-28 02:47:14.965537500 at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1811) 2013-08-28 02:47:14.965538500 at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:407) 2013-08-28 02:47:14.965539500 at org.postgresql.jdbc2.AbstractJdbc2Statement.executeBatch(AbstractJdbc2Statement.java:2725) 2013-08-28 02:47:14.965539500 at org.hibernate.engine.jdbc.batch.internal.BatchingBatch.performExecution(BatchingBatch.java:110) 2013-08-28 02:47:14.965540500 ... 48 more 2013-08-28 02:47:14.965541500 Aug 28, 2013 2:47:14 AM org.apache.catalina.core.StandardWrapperValve invoke 2013-08-28 02:47:14.965543500 SEVERE: Servlet.service() for servlet jersey-servlet threw exception 2013-08-28 02:47:14.965543500 org.springframework.dao.DataIntegrityViolationException: could not perform addBatch; SQL [insert into cwd_token (directory_id, entity_name, random_number, identifier_hash, random_hash, created_date, last_accessed_date, last_accessed_time, duration, id) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]; constraint [null]; nested exception is org.hibernate.exception.ConstraintViolationException: could not perform addBatch 2013-08-28 02:47:14.965546500 at org.springframework.orm.hibernate4.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:138) 2013-08-28 02:47:14.965549500 at org.springframework.orm.hibernate4.HibernateTransactionManager.convertHibernateAccessException(HibernateTransactionManager.java:680) 2013-08-28 02:47:14.965550500 at org.springframework.orm.hibernate4.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:562) 2013-08-28 02:47:14.965551500 at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:755) 2013-08-28 02:47:14.965553500 at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:724) 2013-08-28 02:47:14.965554500 at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:475) 2013-08-28 02:47:14.965555500 at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:270) 2013-08-28 02:47:14.965556500 at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94) 2013-08-28 02:47:14.965557500 at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) 2013-08-28 02:47:14.965557500 at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) 2013-08-28 02:47:14.965559500 at $Proxy22.authenticateApplication(Unknown Source) 2013-08-28 02:47:14.965559500 at com.atlassian.crowd.plugin.rest.filter.BasicApplicationAuthenticationFilter.authenticate(BasicApplicationAuthenticationFilter.java:132) 2013-08-28 02:47:14.965560500 at com.atlassian.crowd.plugin.rest.filter.BasicApplicationAuthenticationFilter.doFilter(BasicApplicationAuthenticationFilter.java:86) 2013-08-28 02:47:14.965562500 at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343) 2013-08-28 02:47:14.965563500 at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260) 2013-08-28 02:47:14.965564500 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) 2013-08-28 02:47:14.965565500 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 2013-08-28 02:47:14.965566500 at com.atlassian.crowd.horde.filters.SysadminPasswordExpiryServletFilter.doFilter(SysadminPasswordExpiryServletFilter.java:42) 2013-08-28 02:47:14.965566500 at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343) 2013-08-28 02:47:14.965568500 at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260) 2013-08-28 02:47:14.965568500 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) 2013-08-28 02:47:14.965569500 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 2013-08-28 02:47:14.965569500 at org.springframework.orm.hibernate4.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:152) 2013-08-28 02:47:14.965572500 at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) 2013-08-28 02:47:14.965573500 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) 2013-08-28 02:47:14.965574500 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 2013-08-28 02:47:14.965575500 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) 2013-08-28 02:47:14.965575500 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) 2013-08-28 02:47:14.965576500 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) 2013-08-28 02:47:14.965577500 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) 2013-08-28 02:47:14.965578500 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) 2013-08-28 02:47:14.965578500 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) 2013-08-28 02:47:14.965579500 at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190) 2013-08-28 02:47:14.965579500 at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:291) 2013-08-28 02:47:14.965582500 at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:776) 2013-08-28 02:47:14.965584500 at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:705) 2013-08-28 02:47:14.965584500 at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:898) 2013-08-28 02:47:14.965585500 at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690) 2013-08-28 02:47:14.965585500 at java.lang.Thread.run(Thread.java:662) 2013-08-28 02:47:14.965586500 Caused by: org.hibernate.exception.ConstraintViolationException: could not perform addBatch 2013-08-28 02:47:14.965587500 at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:129) 2013-08-28 02:47:14.965588500 at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49) 2013-08-28 02:47:14.965588500 at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:125) 2013-08-28 02:47:14.965589500 at org.hibernate.engine.jdbc.batch.internal.BatchingBatch.performExecution(BatchingBatch.java:114) 2013-08-28 02:47:14.965590500 at org.hibernate.engine.jdbc.batch.internal.BatchingBatch.doExecuteBatch(BatchingBatch.java:101) 2013-08-28 02:47:14.965591500 at org.hibernate.engine.jdbc.batch.internal.AbstractBatchImpl.execute(AbstractBatchImpl.java:149) 2013-08-28 02:47:14.965593500 at org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl.executeBatch(JdbcCoordinatorImpl.java:198) 2013-08-28 02:47:14.965594500 at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:372) 2013-08-28 02:47:14.965594500 at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:286) 2013-08-28 02:47:14.965595500 at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:339) 2013-08-28 02:47:14.965596500 at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:52) 2013-08-28 02:47:14.965597500 at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1234) 2013-08-28 02:47:14.965597500 at org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:404) 2013-08-28 02:47:14.965598500 at org.hibernate.engine.transaction.internal.jdbc.JdbcTransaction.beforeTransactionCommit(JdbcTransaction.java:101) 2013-08-28 02:47:14.965599500 at org.hibernate.engine.transaction.spi.AbstractTransactionImpl.commit(AbstractTransactionImpl.java:175) 2013-08-28 02:47:14.965600500 at org.springframework.orm.hibernate4.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:554) 2013-08-28 02:47:14.965601500 ... 36 more 2013-08-28 02:47:14.965601500 Caused by: java.sql.BatchUpdateException: Batch entry 0 insert into cwd_token (directory_id, entity_name, random_number, identifier_hash, random_hash, created_date, last_accessed_date, last_accessed_time, duration, id) values ('-1', 'jira', '8655037538040444656', 'hVtW5FElx8qNjHjM06Kw8A00', '9uSHM0TywIF3CK0uhJV5Ow00', '2013-08-28 02:47:14.691000 +00:00:00', '2013-08-28 02:47:14.691000 +00:00:00', '1377658034691', NULL, '491523') was aborted. Call getNextException to see the cause. 2013-08-28 02:47:14.965605500 at org.postgresql.jdbc2.AbstractJdbc2Statement$BatchResultHandler.handleError(AbstractJdbc2Statement.java:2586) 2013-08-28 02:47:14.965606500 at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1811) 2013-08-28 02:47:14.965607500 at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:407) 2013-08-28 02:47:14.965607500 at org.postgresql.jdbc2.AbstractJdbc2Statement.executeBatch(AbstractJdbc2Statement.java:2725) 2013-08-28 02:47:14.965608500 at org.hibernate.engine.jdbc.batch.internal.BatchingBatch.performExecution(BatchingBatch.java:110) 2013-08-28 02:47:14.965609500 ... 48 more 2013-08-28 02:47:14.965609500 2013-08-28 02:47:14,956 TP-Processor1 ERROR [jdbc.batch.internal.BatchingBatch] HHH000315: Exception executing batch [could not perform addBatch] 2013-08-28 02:47:14.968385500 Aug 28, 2013 2:47:14 AM org.apache.catalina.core.StandardWrapperValve invoke 2013-08-28 02:47:14.968386500 SEVERE: Servlet.service() for servlet jersey-servlet threw exception 2013-08-28 02:47:14.968387500 org.springframework.dao.DataIntegrityViolationException: could not perform addBatch; SQL [insert into cwd_token (directory_id, entity_name, random_number, identifier_hash, random_hash, created_date, last_accessed_date, last_accessed_time, duration, id) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]; constraint [null]; nested exception is org.hibernate.exception.ConstraintViolationException: could not perform addBatch 2013-08-28 02:47:14.968392500 at org.springframework.orm.hibernate4.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:138) 2013-08-28 02:47:14.968393500 at org.springframework.orm.hibernate4.HibernateTransactionManager.convertHibernateAccessException(HibernateTransactionManager.java:680) 2013-08-28 02:47:14.968394500 at org.springframework.orm.hibernate4.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:562) 2013-08-28 02:47:14.968395500 at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:755) 2013-08-28 02:47:14.968397500 at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:724) 2013-08-28 02:47:14.968398500 at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:475) 2013-08-28 02:47:14.968399500 at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:270) 2013-08-28 02:47:14.968401500 at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94) 2013-08-28 02:47:14.968401500 at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) 2013-08-28 02:47:14.968402500 at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) 2013-08-28 02:47:14.968403500 at $Proxy22.authenticateApplication(Unknown Source) 2013-08-28 02:47:14.968404500 at com.atlassian.crowd.plugin.rest.filter.BasicApplicationAuthenticationFilter.authenticate(BasicApplicationAuthenticationFilter.java:132) 2013-08-28 02:47:14.968405500 at com.atlassian.crowd.plugin.rest.filter.BasicApplicationAuthenticationFilter.doFilter(BasicApplicationAuthenticationFilter.java:86) 2013-08-28 02:47:14.968407500 at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343) 2013-08-28 02:47:14.968408500 at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260) 2013-08-28 02:47:14.968408500 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) 2013-08-28 02:47:14.968410500 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 2013-08-28 02:47:14.968410500 at com.atlassian.crowd.horde.filters.SysadminPasswordExpiryServletFilter.doFilter(SysadminPasswordExpiryServletFilter.java:42) 2013-08-28 02:47:14.968411500 at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343) 2013-08-28 02:47:14.968412500 at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260) 2013-08-28 02:47:14.968413500 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) 2013-08-28 02:47:14.968414500 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 2013-08-28 02:47:14.968414500 at org.springframework.orm.hibernate4.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:152) 2013-08-28 02:47:14.968417500 at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) 2013-08-28 02:47:14.968417500 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) 2013-08-28 02:47:14.968418500 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 2013-08-28 02:47:14.968422500 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) 2013-08-28 02:47:14.968422500 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) 2013-08-28 02:47:14.968423500 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) 2013-08-28 02:47:14.968423500 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) 2013-08-28 02:47:14.968425500 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) 2013-08-28 02:47:14.968425500 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) 2013-08-28 02:47:14.968426500 at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190) 2013-08-28 02:47:14.968426500 at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:291) 2013-08-28 02:47:14.968429500 at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:776) 2013-08-28 02:47:14.968429500 at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:705) 2013-08-28 02:47:14.968430500 at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:898) 2013-08-28 02:47:14.968430500 at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690) 2013-08-28 02:47:14.968432500 at java.lang.Thread.run(Thread.java:662) 2013-08-28 02:47:14.968432500 Caused by: org.hibernate.exception.ConstraintViolationException: could not perform addBatch 2013-08-28 02:47:14.968432500 at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:129) 2013-08-28 02:47:14.968433500 at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49) 2013-08-28 02:47:14.968434500 at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:125) 2013-08-28 02:47:14.968435500 at org.hibernate.engine.jdbc.batch.internal.BatchingBatch.performExecution(BatchingBatch.java:114) 2013-08-28 02:47:14.968436500 at org.hibernate.engine.jdbc.batch.internal.BatchingBatch.doExecuteBatch(BatchingBatch.java:101) 2013-08-28 02:47:14.968436500 at org.hibernate.engine.jdbc.batch.internal.AbstractBatchImpl.execute(AbstractBatchImpl.java:149) 2013-08-28 02:47:14.968438500 at org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl.executeBatch(JdbcCoordinatorImpl.java:198) 2013-08-28 02:47:14.968439500 at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:372) 2013-08-28 02:47:14.968440500 at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:286) 2013-08-28 02:47:14.968440500 at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:339) 2013-08-28 02:47:14.968441500 at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:52) 2013-08-28 02:47:14.968442500 at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1234) 2013-08-28 02:47:14.968443500 at org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:404) 2013-08-28 02:47:14.968443500 at org.hibernate.engine.transaction.internal.jdbc.JdbcTransaction.beforeTransactionCommit(JdbcTransaction.java:101) 2013-08-28 02:47:14.968444500 at org.hibernate.engine.transaction.spi.AbstractTransactionImpl.commit(AbstractTransactionImpl.java:175) 2013-08-28 02:47:14.968445500 at org.springframework.orm.hibernate4.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:554) 2013-08-28 02:47:14.968446500 ... 36 more 2013-08-28 02:47:14.968448500 Caused by: java.sql.BatchUpdateException: Batch entry 0 insert into cwd_token (directory_id, entity_name, random_number, identifier_hash, random_hash, created_date, last_accessed_date, last_accessed_time, duration, id) values ('-1', 'jira', '9043271484788623239', 'hVtW5FElx8qNjHjM06Kw8A00', 'oaDMcq1gFxaNbljtKKp0Bg00', '2013-08-28 02:47:14.702000 +00:00:00', '2013-08-28 02:47:14.702000 +00:00:00', '1377658034702', NULL, '491524') was aborted. Call getNextException to see the cause. 2013-08-28 02:47:14.968453500 at org.postgresql.jdbc2.AbstractJdbc2Statement$BatchResultHandler.handleError(AbstractJdbc2Statement.java:2586) 2013-08-28 02:47:14.968454500 at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1811) 2013-08-28 02:47:14.968454500 at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:407) 2013-08-28 02:47:14.968455500 at org.postgresql.jdbc2.AbstractJdbc2Statement.executeBatch(AbstractJdbc2Statement.java:2725) 2013-08-28 02:47:14.968455500 at org.hibernate.engine.jdbc.batch.internal.BatchingBatch.performExecution(BatchingBatch.java:110) 2013-08-28 02:47:14.968457500 ... 48 more {noformat} It would be good if this could be resolved soon.

    Atlassian JIRA | 3 years ago | Robert Massaioli
    org.hibernate.exception.ConstraintViolationException: could not perform addBatch 2013-08-28 02:47:14.965515500 at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:129) 2013-08-28 02:47:14.965516500 at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49) 2013-08-28 02:47:14.965519500 at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:125) 2013-08-28 02:47:14.965519500 at org.hibernate.engine.jdbc.batch.internal.BatchingBatch.performExecution(BatchingBatch.java:114)
  3. 0

    If you look at these logs you can see that Crowd has a race condition if multiple REST calls attempt to create multiple tokens at the same time: {noformat} 2013-08-28 02:47:14.952800500 2013-08-28 02:47:14,950 TP-Processor7 WARN [engine.jdbc.spi.SqlExceptionHelper] SQL Error: 0, SQLState: 23505 2013-08-28 02:47:14.952801500 2013-08-28 02:47:14,950 TP-Processor7 ERROR [engine.jdbc.spi.SqlExceptionHelper] Batch entry 0 insert into cwd_token (directory_id, entity_name, random_number, identifier_hash, random_hash, created_date, last_accessed_date, last_accessed_time, duration, id) values ('-1', 'jira', '8655037538040444656', 'hVtW5FElx8qNjHjM06Kw8A00', '9uSHM0TywIF3CK0uhJV5Ow00', '2013-08-28 02:47:14.691000 +00:00:00', '2013-08-28 02:47:14.691000 +00:00:00', '1377658034691', NULL, '491523') was aborted. Call getNextException to see the cause. 2013-08-28 02:47:14.952816500 2013-08-28 02:47:14,950 TP-Processor7 WARN [engine.jdbc.spi.SqlExceptionHelper] SQL Error: 0, SQLState: 23505 2013-08-28 02:47:14.952817500 2013-08-28 02:47:14,950 TP-Processor7 ERROR [engine.jdbc.spi.SqlExceptionHelper] ERROR: duplicate key value violates unique constraint "cwd_token_identifier_hash_key" 2013-08-28 02:47:14.952818500 2013-08-28 02:47:14,951 TP-Processor7 ERROR [jdbc.batch.internal.BatchingBatch] HHH000315: Exception executing batch [could not perform addBatch] 2013-08-28 02:47:14.956453500 2013-08-28 02:47:14,952 TP-Processor1 WARN [engine.jdbc.spi.SqlExceptionHelper] SQL Error: 0, SQLState: 23505 2013-08-28 02:47:14.956455500 2013-08-28 02:47:14,956 TP-Processor1 ERROR [engine.jdbc.spi.SqlExceptionHelper] Batch entry 0 insert into cwd_token (directory_id, entity_name, random_number, identifier_hash, random_hash, created_date, last_accessed_date, last_accessed_time, duration, id) values ('-1', 'jira', '9043271484788623239', 'hVtW5FElx8qNjHjM06Kw8A00', 'oaDMcq1gFxaNbljtKKp0Bg00', '2013-08-28 02:47:14.702000 +00:00:00', '2013-08-28 02:47:14.702000 +00:00:00', '1377658034702', NULL, '491524') was aborted. Call getNextException to see the cause. 2013-08-28 02:47:14.956469500 2013-08-28 02:47:14,956 TP-Processor1 WARN [engine.jdbc.spi.SqlExceptionHelper] SQL Error: 0, SQLState: 23505 2013-08-28 02:47:14.956477500 2013-08-28 02:47:14,956 TP-Processor1 ERROR [engine.jdbc.spi.SqlExceptionHelper] ERROR: duplicate key value violates unique constraint "cwd_token_identifier_hash_key" 2013-08-28 02:47:14.965455500 2013-08-28 02:47:14,952 TP-Processor2 WARN [engine.jdbc.spi.SqlExceptionHelper] SQL Error: 0, SQLState: 23505 2013-08-28 02:47:14.965456500 2013-08-28 02:47:14,957 TP-Processor2 ERROR [engine.jdbc.spi.SqlExceptionHelper] Batch entry 0 insert into cwd_token (directory_id, entity_name, random_number, identifier_hash, random_hash, created_date, last_accessed_date, last_accessed_time, duration, id) values ('-1', 'jira', '510701224900085190', 'hVtW5FElx8qNjHjM06Kw8A00', 'imnuLQK84Vunu2kkNXvWwg00', '2013-08-28 02:47:14.719000 +00:00:00', '2013-08-28 02:47:14.719000 +00:00:00', '1377658034719', NULL, '491525') was aborted. Call getNextException to see the cause. 2013-08-28 02:47:14.965465500 2013-08-28 02:47:14,957 TP-Processor2 WARN [engine.jdbc.spi.SqlExceptionHelper] SQL Error: 0, SQLState: 23505 2013-08-28 02:47:14.965466500 2013-08-28 02:47:14,957 TP-Processor2 ERROR [engine.jdbc.spi.SqlExceptionHelper] ERROR: duplicate key value violates unique constraint "cwd_token_identifier_hash_key" 2013-08-28 02:47:14.965467500 2013-08-28 02:47:14,957 TP-Processor2 ERROR [jdbc.batch.internal.BatchingBatch] HHH000315: Exception executing batch [could not perform addBatch] 2013-08-28 02:47:14.965470500 Aug 28, 2013 2:47:14 AM org.apache.catalina.core.StandardWrapperValve invoke 2013-08-28 02:47:14.965470500 SEVERE: Servlet.service() for servlet jersey-servlet threw exception 2013-08-28 02:47:14.965471500 org.springframework.dao.DataIntegrityViolationException: could not perform addBatch; SQL [insert into cwd_token (directory_id, entity_name, random_number, identifier_hash, random_hash, created_date, last_accessed_date, last_accessed_time, duration, id) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]; constraint [null]; nested exception is org.hibernate.exception.ConstraintViolationException: could not perform addBatch 2013-08-28 02:47:14.965474500 at org.springframework.orm.hibernate4.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:138) 2013-08-28 02:47:14.965475500 at org.springframework.orm.hibernate4.HibernateTransactionManager.convertHibernateAccessException(HibernateTransactionManager.java:680) 2013-08-28 02:47:14.965476500 at org.springframework.orm.hibernate4.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:562) 2013-08-28 02:47:14.965476500 at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:755) 2013-08-28 02:47:14.965479500 at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:724) 2013-08-28 02:47:14.965480500 at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:475) 2013-08-28 02:47:14.965481500 at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:270) 2013-08-28 02:47:14.965486500 at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94) 2013-08-28 02:47:14.965486500 at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) 2013-08-28 02:47:14.965487500 at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) 2013-08-28 02:47:14.965488500 at $Proxy22.authenticateApplication(Unknown Source) 2013-08-28 02:47:14.965489500 at com.atlassian.crowd.plugin.rest.filter.BasicApplicationAuthenticationFilter.authenticate(BasicApplicationAuthenticationFilter.java:132) 2013-08-28 02:47:14.965489500 at com.atlassian.crowd.plugin.rest.filter.BasicApplicationAuthenticationFilter.doFilter(BasicApplicationAuthenticationFilter.java:86) 2013-08-28 02:47:14.965492500 at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343) 2013-08-28 02:47:14.965493500 at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260) 2013-08-28 02:47:14.965494500 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) 2013-08-28 02:47:14.965495500 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 2013-08-28 02:47:14.965495500 at com.atlassian.crowd.horde.filters.SysadminPasswordExpiryServletFilter.doFilter(SysadminPasswordExpiryServletFilter.java:42) 2013-08-28 02:47:14.965496500 at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343) 2013-08-28 02:47:14.965498500 at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260) 2013-08-28 02:47:14.965498500 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) 2013-08-28 02:47:14.965499500 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 2013-08-28 02:47:14.965499500 at org.springframework.orm.hibernate4.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:152) 2013-08-28 02:47:14.965502500 at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) 2013-08-28 02:47:14.965502500 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) 2013-08-28 02:47:14.965503500 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 2013-08-28 02:47:14.965504500 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) 2013-08-28 02:47:14.965505500 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) 2013-08-28 02:47:14.965506500 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) 2013-08-28 02:47:14.965506500 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) 2013-08-28 02:47:14.965507500 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) 2013-08-28 02:47:14.965508500 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) 2013-08-28 02:47:14.965508500 at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190) 2013-08-28 02:47:14.965509500 at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:291) 2013-08-28 02:47:14.965511500 at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:776) 2013-08-28 02:47:14.965512500 at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:705) 2013-08-28 02:47:14.965512500 at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:898) 2013-08-28 02:47:14.965513500 at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690) 2013-08-28 02:47:14.965514500 at java.lang.Thread.run(Thread.java:662) 2013-08-28 02:47:14.965514500 Caused by: org.hibernate.exception.ConstraintViolationException: could not perform addBatch 2013-08-28 02:47:14.965515500 at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:129) 2013-08-28 02:47:14.965516500 at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49) 2013-08-28 02:47:14.965519500 at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:125) 2013-08-28 02:47:14.965519500 at org.hibernate.engine.jdbc.batch.internal.BatchingBatch.performExecution(BatchingBatch.java:114) 2013-08-28 02:47:14.965520500 at org.hibernate.engine.jdbc.batch.internal.BatchingBatch.doExecuteBatch(BatchingBatch.java:101) 2013-08-28 02:47:14.965520500 at org.hibernate.engine.jdbc.batch.internal.AbstractBatchImpl.execute(AbstractBatchImpl.java:149) 2013-08-28 02:47:14.965523500 at org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl.executeBatch(JdbcCoordinatorImpl.java:198) 2013-08-28 02:47:14.965523500 at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:372) 2013-08-28 02:47:14.965524500 at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:286) 2013-08-28 02:47:14.965524500 at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:339) 2013-08-28 02:47:14.965526500 at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:52) 2013-08-28 02:47:14.965526500 at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1234) 2013-08-28 02:47:14.965527500 at org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:404) 2013-08-28 02:47:14.965527500 at org.hibernate.engine.transaction.internal.jdbc.JdbcTransaction.beforeTransactionCommit(JdbcTransaction.java:101) 2013-08-28 02:47:14.965529500 at org.hibernate.engine.transaction.spi.AbstractTransactionImpl.commit(AbstractTransactionImpl.java:175) 2013-08-28 02:47:14.965529500 at org.springframework.orm.hibernate4.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:554) 2013-08-28 02:47:14.965533500 ... 36 more 2013-08-28 02:47:14.965533500 Caused by: java.sql.BatchUpdateException: Batch entry 0 insert into cwd_token (directory_id, entity_name, random_number, identifier_hash, random_hash, created_date, last_accessed_date, last_accessed_time, duration, id) values ('-1', 'jira', '510701224900085190', 'hVtW5FElx8qNjHjM06Kw8A00', 'imnuLQK84Vunu2kkNXvWwg00', '2013-08-28 02:47:14.719000 +00:00:00', '2013-08-28 02:47:14.719000 +00:00:00', '1377658034719', NULL, '491525') was aborted. Call getNextException to see the cause. 2013-08-28 02:47:14.965536500 at org.postgresql.jdbc2.AbstractJdbc2Statement$BatchResultHandler.handleError(AbstractJdbc2Statement.java:2586) 2013-08-28 02:47:14.965537500 at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1811) 2013-08-28 02:47:14.965538500 at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:407) 2013-08-28 02:47:14.965539500 at org.postgresql.jdbc2.AbstractJdbc2Statement.executeBatch(AbstractJdbc2Statement.java:2725) 2013-08-28 02:47:14.965539500 at org.hibernate.engine.jdbc.batch.internal.BatchingBatch.performExecution(BatchingBatch.java:110) 2013-08-28 02:47:14.965540500 ... 48 more 2013-08-28 02:47:14.965541500 Aug 28, 2013 2:47:14 AM org.apache.catalina.core.StandardWrapperValve invoke 2013-08-28 02:47:14.965543500 SEVERE: Servlet.service() for servlet jersey-servlet threw exception 2013-08-28 02:47:14.965543500 org.springframework.dao.DataIntegrityViolationException: could not perform addBatch; SQL [insert into cwd_token (directory_id, entity_name, random_number, identifier_hash, random_hash, created_date, last_accessed_date, last_accessed_time, duration, id) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]; constraint [null]; nested exception is org.hibernate.exception.ConstraintViolationException: could not perform addBatch 2013-08-28 02:47:14.965546500 at org.springframework.orm.hibernate4.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:138) 2013-08-28 02:47:14.965549500 at org.springframework.orm.hibernate4.HibernateTransactionManager.convertHibernateAccessException(HibernateTransactionManager.java:680) 2013-08-28 02:47:14.965550500 at org.springframework.orm.hibernate4.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:562) 2013-08-28 02:47:14.965551500 at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:755) 2013-08-28 02:47:14.965553500 at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:724) 2013-08-28 02:47:14.965554500 at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:475) 2013-08-28 02:47:14.965555500 at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:270) 2013-08-28 02:47:14.965556500 at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94) 2013-08-28 02:47:14.965557500 at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) 2013-08-28 02:47:14.965557500 at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) 2013-08-28 02:47:14.965559500 at $Proxy22.authenticateApplication(Unknown Source) 2013-08-28 02:47:14.965559500 at com.atlassian.crowd.plugin.rest.filter.BasicApplicationAuthenticationFilter.authenticate(BasicApplicationAuthenticationFilter.java:132) 2013-08-28 02:47:14.965560500 at com.atlassian.crowd.plugin.rest.filter.BasicApplicationAuthenticationFilter.doFilter(BasicApplicationAuthenticationFilter.java:86) 2013-08-28 02:47:14.965562500 at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343) 2013-08-28 02:47:14.965563500 at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260) 2013-08-28 02:47:14.965564500 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) 2013-08-28 02:47:14.965565500 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 2013-08-28 02:47:14.965566500 at com.atlassian.crowd.horde.filters.SysadminPasswordExpiryServletFilter.doFilter(SysadminPasswordExpiryServletFilter.java:42) 2013-08-28 02:47:14.965566500 at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343) 2013-08-28 02:47:14.965568500 at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260) 2013-08-28 02:47:14.965568500 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) 2013-08-28 02:47:14.965569500 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 2013-08-28 02:47:14.965569500 at org.springframework.orm.hibernate4.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:152) 2013-08-28 02:47:14.965572500 at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) 2013-08-28 02:47:14.965573500 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) 2013-08-28 02:47:14.965574500 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 2013-08-28 02:47:14.965575500 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) 2013-08-28 02:47:14.965575500 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) 2013-08-28 02:47:14.965576500 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) 2013-08-28 02:47:14.965577500 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) 2013-08-28 02:47:14.965578500 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) 2013-08-28 02:47:14.965578500 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) 2013-08-28 02:47:14.965579500 at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190) 2013-08-28 02:47:14.965579500 at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:291) 2013-08-28 02:47:14.965582500 at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:776) 2013-08-28 02:47:14.965584500 at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:705) 2013-08-28 02:47:14.965584500 at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:898) 2013-08-28 02:47:14.965585500 at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690) 2013-08-28 02:47:14.965585500 at java.lang.Thread.run(Thread.java:662) 2013-08-28 02:47:14.965586500 Caused by: org.hibernate.exception.ConstraintViolationException: could not perform addBatch 2013-08-28 02:47:14.965587500 at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:129) 2013-08-28 02:47:14.965588500 at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49) 2013-08-28 02:47:14.965588500 at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:125) 2013-08-28 02:47:14.965589500 at org.hibernate.engine.jdbc.batch.internal.BatchingBatch.performExecution(BatchingBatch.java:114) 2013-08-28 02:47:14.965590500 at org.hibernate.engine.jdbc.batch.internal.BatchingBatch.doExecuteBatch(BatchingBatch.java:101) 2013-08-28 02:47:14.965591500 at org.hibernate.engine.jdbc.batch.internal.AbstractBatchImpl.execute(AbstractBatchImpl.java:149) 2013-08-28 02:47:14.965593500 at org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl.executeBatch(JdbcCoordinatorImpl.java:198) 2013-08-28 02:47:14.965594500 at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:372) 2013-08-28 02:47:14.965594500 at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:286) 2013-08-28 02:47:14.965595500 at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:339) 2013-08-28 02:47:14.965596500 at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:52) 2013-08-28 02:47:14.965597500 at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1234) 2013-08-28 02:47:14.965597500 at org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:404) 2013-08-28 02:47:14.965598500 at org.hibernate.engine.transaction.internal.jdbc.JdbcTransaction.beforeTransactionCommit(JdbcTransaction.java:101) 2013-08-28 02:47:14.965599500 at org.hibernate.engine.transaction.spi.AbstractTransactionImpl.commit(AbstractTransactionImpl.java:175) 2013-08-28 02:47:14.965600500 at org.springframework.orm.hibernate4.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:554) 2013-08-28 02:47:14.965601500 ... 36 more 2013-08-28 02:47:14.965601500 Caused by: java.sql.BatchUpdateException: Batch entry 0 insert into cwd_token (directory_id, entity_name, random_number, identifier_hash, random_hash, created_date, last_accessed_date, last_accessed_time, duration, id) values ('-1', 'jira', '8655037538040444656', 'hVtW5FElx8qNjHjM06Kw8A00', '9uSHM0TywIF3CK0uhJV5Ow00', '2013-08-28 02:47:14.691000 +00:00:00', '2013-08-28 02:47:14.691000 +00:00:00', '1377658034691', NULL, '491523') was aborted. Call getNextException to see the cause. 2013-08-28 02:47:14.965605500 at org.postgresql.jdbc2.AbstractJdbc2Statement$BatchResultHandler.handleError(AbstractJdbc2Statement.java:2586) 2013-08-28 02:47:14.965606500 at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1811) 2013-08-28 02:47:14.965607500 at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:407) 2013-08-28 02:47:14.965607500 at org.postgresql.jdbc2.AbstractJdbc2Statement.executeBatch(AbstractJdbc2Statement.java:2725) 2013-08-28 02:47:14.965608500 at org.hibernate.engine.jdbc.batch.internal.BatchingBatch.performExecution(BatchingBatch.java:110) 2013-08-28 02:47:14.965609500 ... 48 more 2013-08-28 02:47:14.965609500 2013-08-28 02:47:14,956 TP-Processor1 ERROR [jdbc.batch.internal.BatchingBatch] HHH000315: Exception executing batch [could not perform addBatch] 2013-08-28 02:47:14.968385500 Aug 28, 2013 2:47:14 AM org.apache.catalina.core.StandardWrapperValve invoke 2013-08-28 02:47:14.968386500 SEVERE: Servlet.service() for servlet jersey-servlet threw exception 2013-08-28 02:47:14.968387500 org.springframework.dao.DataIntegrityViolationException: could not perform addBatch; SQL [insert into cwd_token (directory_id, entity_name, random_number, identifier_hash, random_hash, created_date, last_accessed_date, last_accessed_time, duration, id) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]; constraint [null]; nested exception is org.hibernate.exception.ConstraintViolationException: could not perform addBatch 2013-08-28 02:47:14.968392500 at org.springframework.orm.hibernate4.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:138) 2013-08-28 02:47:14.968393500 at org.springframework.orm.hibernate4.HibernateTransactionManager.convertHibernateAccessException(HibernateTransactionManager.java:680) 2013-08-28 02:47:14.968394500 at org.springframework.orm.hibernate4.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:562) 2013-08-28 02:47:14.968395500 at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:755) 2013-08-28 02:47:14.968397500 at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:724) 2013-08-28 02:47:14.968398500 at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:475) 2013-08-28 02:47:14.968399500 at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:270) 2013-08-28 02:47:14.968401500 at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94) 2013-08-28 02:47:14.968401500 at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) 2013-08-28 02:47:14.968402500 at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) 2013-08-28 02:47:14.968403500 at $Proxy22.authenticateApplication(Unknown Source) 2013-08-28 02:47:14.968404500 at com.atlassian.crowd.plugin.rest.filter.BasicApplicationAuthenticationFilter.authenticate(BasicApplicationAuthenticationFilter.java:132) 2013-08-28 02:47:14.968405500 at com.atlassian.crowd.plugin.rest.filter.BasicApplicationAuthenticationFilter.doFilter(BasicApplicationAuthenticationFilter.java:86) 2013-08-28 02:47:14.968407500 at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343) 2013-08-28 02:47:14.968408500 at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260) 2013-08-28 02:47:14.968408500 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) 2013-08-28 02:47:14.968410500 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 2013-08-28 02:47:14.968410500 at com.atlassian.crowd.horde.filters.SysadminPasswordExpiryServletFilter.doFilter(SysadminPasswordExpiryServletFilter.java:42) 2013-08-28 02:47:14.968411500 at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343) 2013-08-28 02:47:14.968412500 at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260) 2013-08-28 02:47:14.968413500 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) 2013-08-28 02:47:14.968414500 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 2013-08-28 02:47:14.968414500 at org.springframework.orm.hibernate4.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:152) 2013-08-28 02:47:14.968417500 at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) 2013-08-28 02:47:14.968417500 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) 2013-08-28 02:47:14.968418500 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 2013-08-28 02:47:14.968422500 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) 2013-08-28 02:47:14.968422500 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) 2013-08-28 02:47:14.968423500 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) 2013-08-28 02:47:14.968423500 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) 2013-08-28 02:47:14.968425500 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) 2013-08-28 02:47:14.968425500 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) 2013-08-28 02:47:14.968426500 at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190) 2013-08-28 02:47:14.968426500 at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:291) 2013-08-28 02:47:14.968429500 at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:776) 2013-08-28 02:47:14.968429500 at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:705) 2013-08-28 02:47:14.968430500 at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:898) 2013-08-28 02:47:14.968430500 at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690) 2013-08-28 02:47:14.968432500 at java.lang.Thread.run(Thread.java:662) 2013-08-28 02:47:14.968432500 Caused by: org.hibernate.exception.ConstraintViolationException: could not perform addBatch 2013-08-28 02:47:14.968432500 at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:129) 2013-08-28 02:47:14.968433500 at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49) 2013-08-28 02:47:14.968434500 at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:125) 2013-08-28 02:47:14.968435500 at org.hibernate.engine.jdbc.batch.internal.BatchingBatch.performExecution(BatchingBatch.java:114) 2013-08-28 02:47:14.968436500 at org.hibernate.engine.jdbc.batch.internal.BatchingBatch.doExecuteBatch(BatchingBatch.java:101) 2013-08-28 02:47:14.968436500 at org.hibernate.engine.jdbc.batch.internal.AbstractBatchImpl.execute(AbstractBatchImpl.java:149) 2013-08-28 02:47:14.968438500 at org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl.executeBatch(JdbcCoordinatorImpl.java:198) 2013-08-28 02:47:14.968439500 at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:372) 2013-08-28 02:47:14.968440500 at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:286) 2013-08-28 02:47:14.968440500 at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:339) 2013-08-28 02:47:14.968441500 at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:52) 2013-08-28 02:47:14.968442500 at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1234) 2013-08-28 02:47:14.968443500 at org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:404) 2013-08-28 02:47:14.968443500 at org.hibernate.engine.transaction.internal.jdbc.JdbcTransaction.beforeTransactionCommit(JdbcTransaction.java:101) 2013-08-28 02:47:14.968444500 at org.hibernate.engine.transaction.spi.AbstractTransactionImpl.commit(AbstractTransactionImpl.java:175) 2013-08-28 02:47:14.968445500 at org.springframework.orm.hibernate4.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:554) 2013-08-28 02:47:14.968446500 ... 36 more 2013-08-28 02:47:14.968448500 Caused by: java.sql.BatchUpdateException: Batch entry 0 insert into cwd_token (directory_id, entity_name, random_number, identifier_hash, random_hash, created_date, last_accessed_date, last_accessed_time, duration, id) values ('-1', 'jira', '9043271484788623239', 'hVtW5FElx8qNjHjM06Kw8A00', 'oaDMcq1gFxaNbljtKKp0Bg00', '2013-08-28 02:47:14.702000 +00:00:00', '2013-08-28 02:47:14.702000 +00:00:00', '1377658034702', NULL, '491524') was aborted. Call getNextException to see the cause. 2013-08-28 02:47:14.968453500 at org.postgresql.jdbc2.AbstractJdbc2Statement$BatchResultHandler.handleError(AbstractJdbc2Statement.java:2586) 2013-08-28 02:47:14.968454500 at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1811) 2013-08-28 02:47:14.968454500 at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:407) 2013-08-28 02:47:14.968455500 at org.postgresql.jdbc2.AbstractJdbc2Statement.executeBatch(AbstractJdbc2Statement.java:2725) 2013-08-28 02:47:14.968455500 at org.hibernate.engine.jdbc.batch.internal.BatchingBatch.performExecution(BatchingBatch.java:110) 2013-08-28 02:47:14.968457500 ... 48 more {noformat} It would be good if this could be resolved soon.

    Atlassian JIRA | 3 years ago | Robert Massaioli
    org.hibernate.exception.ConstraintViolationException: could not perform addBatch 2013-08-28 02:47:14.965515500 at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:129) 2013-08-28 02:47:14.965516500 at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49) 2013-08-28 02:47:14.965519500 at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:125) 2013-08-28 02:47:14.965519500 at org.hibernate.engine.jdbc.batch.internal.BatchingBatch.performExecution(BatchingBatch.java:114)
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Hibernate and/or JDBC batch insert/update exception handling

    Stack Overflow | 3 years ago | JRun
    org.hibernate.exception.ConstraintViolationException: could not execute batch at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:129)
  6. 0

    Fails to add movie

    GitHub | 3 years ago | cptjhmiller
    org.hibernate.exception.ConstraintViolationException: could not execute statement at org.hibernate.exception.internal.SQLExceptionTypeDelegate.convert(SQLExceptionTy​peDelegate.java:74) at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardS​QLExceptionConverter.java:49) at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java​:125) at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java​:110) at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetRe​turnImpl.java:136) at org.hibernate.id.IdentityGenerator$GetGeneratedKeysDelegate.executeAndExtract(Id​entityGenerator.java:96) at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturnin​gDelegate.java:58) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPers​ister.java:2975) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPers​ister.java:3487) at org.hibernate.action.internal.EntityIdentityInsertAction.execute(EntityIdentityI​nsertAction.java:81)

  1. linxiaolong 1 times, last 4 days ago
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 perform addBatch 2013-08-28 02:47:14.965515500 at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:129) 2013-08-28 02:47:14.965516500 at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49) 2013-08-28 02:47:14.965519500 at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:125) 2013-08-28 02:47:14.965519500 at org.hibernate.engine.jdbc.batch.internal.BatchingBatch.performExecution(BatchingBatch.java:114)

    at org.hibernate.engine.jdbc.batch.internal.BatchingBatch.doExecuteBatch()
  2. Hibernate
    AbstractBatchImpl.execute
    1. org.hibernate.engine.jdbc.batch.internal.BatchingBatch.doExecuteBatch(BatchingBatch.java:101)
    2. org.hibernate.engine.jdbc.batch.internal.AbstractBatchImpl.execute(AbstractBatchImpl.java:149)
    2 frames