Transaction (Process ID) was deadlocked on lock resources with another process and has been chose

版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/jcx5083761/article/details/7678490

        最近在做多线程处理sql server2008某个表中的数据时,在Update记录的时候出现了【Transaction (Process ID 146) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction】显示的错误,百思不得其解,还以为是程序中应用了lock的原因导致死锁呢,后来发现不是这么回事,是我处理的表没有设置主键,而更新时是根据主键进行更新的。

        又仔细一想,是因为我更新的这个表是通过sql server2008自带的导入表的功能倒过来了,原来的表是有主键的,但是通过导入方式过来的新表确实没有主键的,这个问题不太清楚,如果提前知道,设置好主键就不会出现这样的问题了。

展开阅读全文

spring错误:Transaction has been rolled back because it has been marked as rollback

11-20

就是下面这个错误,原因查了好几天了,没什么头绪,好像是动态代理提交事务时出错的,另外Proxy141是什么意思?请各位前辈指点,谢谢!rnrn2007-11-13 18:14:35 StandardWrapperValve[action]: Servlet.service() for servlet action threw exceptionrnorg.springframework.transaction.UnexpectedRollbackException: Transaction has been rolled back because it has been marked as rollbackrn-onlyrn at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.javarn:469)rn at org.springframework.transaction.interceptor.TransactionAspectSupport.doCommitTransactionAfterReturning(TransactionAspectSrnupport.java:267)rn at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)rn at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176)rn at $Proxy141.getCmsPublishType(Unknown Source)rn at com.metinform.easycargo.portal.struts.ViewContentAction.viewOneContent(Unknown Source)rn at com.metinform.easycargo.portal.struts.ViewContentAction.execute(Unknown Source)rn at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)rn at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)rn at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)rn at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)rn at com.metinform.util.web.filter.SetCharacterEncodingFilter.doFilter(Unknown Source)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)rn at com.metinform.easycargo.portal.web.servlet.PortalMemuFilter.doFilter(Unknown Source)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)rn at com.metinform.util.web.filter.SetCharacterEncodingFilter.doFilter(Unknown Source)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)rn at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)rn at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)rn at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)rn at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)rn at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:540)rn at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)rn at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)rn at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)rn at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)rn at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)rn at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)rn at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)rn at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)rn at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)rn at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)rn at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)rn at java.lang.Thread.run(Thread.java:595) 论坛

没有更多推荐了,返回首页