org.hibernate.exception.ConstraintViolationException - Could not execute JDBC batch update
Asked by GermanALeman:


Answers:
author: GermanALeman
body: I'm just trying to login.

2015-06-10 10:15:53,253 ERROR - Commit failed. Rolling back.  
org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update  
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:96)  
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)  
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:275)  
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:262)  
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:178)  
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)  
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:51)  
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1206)  
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:375)  
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:137)  
at com.cenqua.crucible.hibernate.SessionState.commit(SessionState.java:127)  
at com.cenqua.crucible.hibernate.SessionState.commitAllTx(SessionState.java:82)  
at com.cenqua.crucible.hibernate.SessionState.commitTx(SessionState.java:74)  
at com.cenqua.crucible.hibernate.HibernateUtil.commitTransaction(HibernateUtil.java:322)  
at com.atlassian.fecru.tx.TxHelperStylePlatformTransactionManager.commit(TxHelperStylePlatformTransactionManager.java:37)  
at com.atlassian.fisheye.spi.impl.DefaultTxTemplate.execute(DefaultTxTemplate.java:82)  
at com.cenqua.fisheye.user.DefaultUserManager.createRememberMeCookie(DefaultUserManager.java:544)  
at com.cenqua.fisheye.user.DefaultUserManager.loginWithSanitizedUserName(DefaultUserManager.java:537)  
at com.cenqua.fisheye.user.DefaultUserManager.login(DefaultUserManager.java:440)  
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)  
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)  
at java.lang.reflect.Method.invoke(Method.java:497)  
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:319)  
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:196)  
at com.sun.proxy.$Proxy45.login(Unknown Source)  
at com.cenqua.fisheye.web.LoginServlet.login(LoginServlet.java:127)  
at com.cenqua.fisheye.web.LoginServlet.doLogin(LoginServlet.java:85)  
at com.cenqua.fisheye.web.LoginServlet.doGet(LoginServlet.java:71)  
at com.cenqua.fisheye.web.LoginServlet.doPost(LoginServlet.java:63)  
at javax.servlet.http.HttpServlet.service(HttpServlet.java:755)  
at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)  
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:669)  
at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1526)  
at com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:46)  
at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter$1.doFilter(DelegatingPluginFilter.java:66)  
at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:25)  
at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter.doFilter(DelegatingPluginFilter.java:74)  
at com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:42)  
at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter$1.doFilter(DelegatingPluginFilter.java:66)  
at com.atlassian.prettyurls.filter.PrettyUrlsSiteMeshFixupFilter.doFilter(PrettyUrlsSiteMeshFixupFilter.java:36)  
at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter.doFilter(DelegatingPluginFilter.java:74)  
at com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:42)  
at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter$1.doFilter(DelegatingPluginFilter.java:66)  
at com.atlassian.prettyurls.filter.PrettyUrlsDispatcherFilter.doFilter(PrettyUrlsDispatcherFilter.java:60)  
at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter.doFilter(DelegatingPluginFilter.java:74)  
at com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:42)  
at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter$1.doFilter(DelegatingPluginFilter.java:66)  
at com.atlassian.prettyurls.filter.PrettyUrlsSiteMeshFilter.doFilter(PrettyUrlsSiteMeshFilter.java:92)  
at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter.doFilter(DelegatingPluginFilter.java:74)  
at com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:42)  
at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter$1.doFilter(DelegatingPluginFilter.java:66)  
at com.atlassian.prettyurls.filter.PrettyUrlsMatcherFilter.doFilter(PrettyUrlsMatcherFilter.java:56)  
at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter.doFilter(DelegatingPluginFilter.java:74)  
at com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:42)  
at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:77)  
at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:63)  
at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1502)  
at com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:46)  
at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter$1.doFilter(DelegatingPluginFilter.java:66)  
at com.atlassian.prettyurls.filter.PrettyUrlsCombinedMatchDispatcherFilter.doFilter(PrettyUrlsCombinedMatchDispatcherFilter.java:61)  
at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter.doFilter(DelegatingPluginFilter.java:74)  
at com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:42)  
at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:77)  
at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:63)  
at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1502)  
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:83)  
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)  
at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1502)  
at com.atlassian.crucible.filters.CrucibleFilter.doFilter(CrucibleFilter.java:148)  
at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1502)  
at com.cenqua.fisheye.web.filters.TotalityFilter.doFilter(TotalityFilter.java:301)  
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)  
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)  
at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1502)  
at com.atlassian.security.auth.trustedapps.filter.TrustedApplicationsFilter.doFilter(TrustedApplicationsFilter.java:100)  
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)  
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)  
at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1502)  
at com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:46)  
at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter$1.doFilter(DelegatingPluginFilter.java:66)  
at com.atlassian.oauth.serviceprovider.internal.servlet.OAuthFilter.doFilter(OAuthFilter.java:69)  
at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter.doFilter(DelegatingPluginFilter.java:74)  
at com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:42)  
at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter$1.doFilter(DelegatingPluginFilter.java:66)  
at com.atlassian.prettyurls.filter.PrettyUrlsCombinedMatchDispatcherFilter.doFilter(PrettyUrlsCombinedMatchDispatcherFilter.java:61)  
at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter.doFilter(DelegatingPluginFilter.java:74)  
at com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:42)  
at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:77)  
at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:63)  
at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1502)  
at org.eclipse.jetty.servlets.UserAgentFilter.doFilter(UserAgentFilter.java:82)  
at org.eclipse.jetty.servlets.GzipFilter.doFilter(GzipFilter.java:256)  
at com.cenqua.fisheye.web.filters.CustomIncludableGzipFilter.doFilter(CustomIncludableGzipFilter.java:27)  
at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1502)  
at com.cenqua.fisheye.web.filters.ProductInfoFilter.doFilter(ProductInfoFilter.java:44)  
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)  
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)  
at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1502)  
at com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:46)  
at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter$1.doFilter(DelegatingPluginFilter.java:66)  
at com.atlassian.prettyurls.filter.PrettyUrlsCombinedMatchDispatcherFilter.doFilter(PrettyUrlsCombinedMatchDispatcherFilter.java:61)  
at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter.doFilter(DelegatingPluginFilter.java:74)  
at com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:42)  
at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:77)  
at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:63)  
at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1502)  
at com.cenqua.fisheye.web.filters.UpfrontFilter.doFilter(UpfrontFilter.java:60)  
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)  
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)  
at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1502)  
at com.atlassian.fecru.profiling.ProfilingServletFilter.doFilter(ProfilingServletFilter.java:62)  
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)  
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)  
at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1502)  
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:455)  
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)  
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:557)  
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)  
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1075)  
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:384)  
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)  
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1009)  
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)  
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255)  
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154)  
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)  
at org.eclipse.jetty.server.Server.handle(Server.java:368)  
at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489)  
at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:953)  
at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:1014)  
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:861)  
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)  
at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)  
at [org.eclipse.jetty.io](http://org.eclipse.jetty.io).nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:628)  
at [org.eclipse.jetty.io](http://org.eclipse.jetty.io).nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)  
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)  
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)  
at java.lang.Thread.run(Thread.java:745)  
Caused by: java.sql.BatchUpdateException: Batch entry 0 insert into cru_login_cookie (cru_user_id, cru_rnd, cru_create_date, cru_type, cru_url, cru_recursive_url, cru_login_cookie_id) values ('115', '0fb969018c94459c04edfbfb8664dfdd', '1433956553245', '1', NULL, '0', '7898') was aborted. Call getNextException to see the cause.  
at org.postgresql.jdbc2.AbstractJdbc2Statement$BatchResultHandler.handleError(AbstractJdbc2Statement.java:2569)  
at org.postgresql.core.v3.QueryExecutorImpl$1.handleError(QueryExecutorImpl.java:459)  
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1796)  
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:407)  
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeBatch(AbstractJdbc2Statement.java:2708)  
at com.jolbox.bonecp.StatementHandle.executeBatch(StatementHandle.java:469)  
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:70)  
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:268)  
... 136 more  


author: gustavo_refosco
body: Hi German,This error is very generic, so it's hard to say what the issue is based on it. Could you please provide a little more context, informing1. What action are you performing that's causing this error?2. With debug enabled do you have any further info on this in your logs?Regards,Gustavo Refosco


Tags: fisheye-crucible-administration