org.hibernate.exception.SQLGrammarException: could not execute batch

Google Groups | Stefan Fritzsche | 1 month ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 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)
  2. 0

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

    atlassian.com | 2 years 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)
  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 | 4 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

    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 | 4 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)
  6. 0

    Hibernate issue " Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1"

    Stack Overflow | 3 years ago | Stony
    org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1

    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.postgresql.util.PSQLException

      ERROR: syntax error at or near "." Position: 13

      at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse()
    2. PostgreSQL JDBC Driver
      QueryExecutorImpl.execute
      1. org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2458)
      2. org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2158)
      3. org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:463)
      3 frames
    3. org.postgresql.jdbc
      PgPreparedStatement.executeBatch
      1. org.postgresql.jdbc.PgStatement.executeBatch(PgStatement.java:794)
      2. org.postgresql.jdbc.PgPreparedStatement.executeBatch(PgPreparedStatement.java:1662)
      2 frames
    4. Apache Commons DBCP
      DelegatingStatement.executeBatch
      1. org.apache.commons.dbcp2.DelegatingStatement.executeBatch(DelegatingStatement.java:345)
      2. org.apache.commons.dbcp2.DelegatingStatement.executeBatch(DelegatingStatement.java:345)
      2 frames
    5. Hibernate
      SessionImpl.flush
      1. org.hibernate.engine.jdbc.batch.internal.BatchingBatch.performExecution(BatchingBatch.java:113)
      2. org.hibernate.engine.jdbc.batch.internal.BatchingBatch.doExecuteBatch(BatchingBatch.java:101)
      3. org.hibernate.engine.jdbc.batch.internal.AbstractBatchImpl.execute(AbstractBatchImpl.java:161)
      4. org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl.executeBatch(JdbcCoordinatorImpl.java:207)
      5. org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:390)
      6. org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:310)
      7. org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:349)
      8. org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:56)
      9. org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1195)
      9 frames
    6. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:498)
      4 frames
    7. Hibernate
      ThreadLocalSessionContext$TransactionProtectionWrapper.invoke
      1. org.hibernate.context.internal.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:352)
      1 frame
    8. com.sun.proxy
      $Proxy41.flush
      1. com.sun.proxy.$Proxy41.flush(Unknown Source)
      1 frame
    9. DSpace Kernel :: API and Implementation
      DSpaceWebappListener.contextDestroyed
      1. org.dspace.core.HibernateDBConnection.commit(HibernateDBConnection.java:84)
      2. org.dspace.core.Context.commit(Context.java:402)
      3. org.dspace.core.Context.complete(Context.java:354)
      4. org.dspace.app.util.AbstractDSpaceWebapp.deregister(AbstractDSpaceWebapp.java:89)
      5. org.dspace.app.util.DSpaceWebappListener.contextDestroyed(DSpaceWebappListener.java:43)
      5 frames
    10. Glassfish Core
      HostConfig$DeployDirectory.run
      1. org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:5115)
      2. org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5779)
      3. org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:224)
      4. org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:159)
      5. org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899)
      6. org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)
      7. org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
      8. org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1260)
      9. org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:2002)
      9 frames
    11. Java RT
      Thread.run
      1. java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      2. java.util.concurrent.FutureTask.run(FutureTask.java:266)
      3. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      4. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      5. java.lang.Thread.run(Thread.java:745)
      5 frames