qq_40164184
qq_40164184
2017-12-04 08:01

Java异常Could not execute JDBC batch update

  • java
  • jdbc
  • 异常

org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:94) ~[hibernate-3.3.2.jar:na]
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66) ~[hibernate-3.3.2.jar:na]
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:275) ~[hibernate-3.3.2.jar:na]
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:266) ~[hibernate-3.3.2.jar:na]
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:170) ~[hibernate-3.3.2.jar:na]
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321) ~[hibernate-3.3.2.jar:na]
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:50) [hibernate-3.3.2.jar:na]
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1028) [hibernate-3.3.2.jar:na]
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:366) [hibernate-3.3.2.jar:na]
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:137) [hibernate-3.3.2.jar:na]
at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:656) [spring.orm-3.0.5.jar:3.0.5.RELEASE]
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:754) [spring.transaction-3.0.5.jar:3.0.5.RELEASE]
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:723) [spring.transaction-3.0.5.jar:3.0.5.RELEASE]
at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:393) [spring.transaction-3.0.5.jar:3.0.5.RELEASE]
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:120) [spring.transaction-3.0.5.jar:3.0.5.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) [spring.aop-3.0.5.jar:3.0.5.RELEASE]
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) [spring.aop-3.0.5.jar:3.0.5.RELEASE]
at com.sun.proxy.$Proxy21.updateAdmin(Unknown Source) [na:na]
at com.jeecms.cms.action.admin.main.CmsAdminLocalAct.update(CmsAdminLocalAct.java:192) [CmsAdminLocalAct.class:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.6.0_45]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.6.0_45]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.6.0_45]
at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.6.0_45]
at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176) [spring.web-3.0.5.jar:3.0.5.RELEASE]
at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:426) [spring.web.servlet-3.0.5.jar:3.0.5.RELEASE]
at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:414) [spring.web.servlet-3.0.5.jar:3.0.5.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790) [spring.web.servlet-3.0.5.jar:3.0.5.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719) [spring.web.servlet-3.0.5.jar:3.0.5.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644) [spring.web.servlet-3.0.5.jar:3.0.5.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560) [spring.web.servlet-3.0.5.jar:3.0.5.RELEASE]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:643) [servlet-api.jar:na]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:723) [servlet-api.jar:na]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) [catalina.jar:6.0.37]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [catalina.jar:6.0.37]
at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198) [spring.orm-3.0.5.jar:3.0.5.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) [spring.web-3.0.5.jar:3.0.5.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) [catalina.jar:6.0.37]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [catalina.jar:6.0.37]
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) [spring.web-3.0.5.jar:3.0.5.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) [spring.web-3.0.5.jar:3.0.5.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) [catalina.jar:6.0.37]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [catalina.jar:6.0.37]
at com.jeecms.common.web.ProcessTimeFilter.doFilter(ProcessTimeFilter.java:35) [ProcessTimeFilter.class:na]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) [catalina.jar:6.0.37]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [catalina.jar:6.0.37]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) [catalina.jar:6.0.37]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) [catalina.jar:6.0.37]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) [catalina.jar:6.0.37]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) [catalina.jar:6.0.37]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [catalina.jar:6.0.37]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) [catalina.jar:6.0.37]
at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:879) [tomcat-coyote.jar:6.0.37]
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:617) [tomcat-coyote.jar:6.0.37]
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1760) [tomcat-coyote.jar:6.0.37]
at java.lang.Thread.run(Unknown Source) [na:1.6.0_45]
Caused by: java.sql.BatchUpdateException: Duplicate entry '863455-186' for key 'PRIMARY'
at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:2016) ~[mysql-connector-5.1.8.jar:na]
at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:1452) ~[mysql-connector-5.1.8.jar:na]
at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeBatch(NewProxyPreparedStatement.java:1723) ~[c3p0-0.9.1.2.jar:0.9.1.2]
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:70) ~[hibernate-3.3.2.jar:na]
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:268) ~[hibernate-3.3.2.jar:na]
... 52 common frames omitted

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

5条回答