seata Duplicate entry 'xxx' for key 'lock_table.PRIMARY'

9njqaruj  于 4个月前  发布在  其他
关注(0)|答案(7)|浏览(67)

Ⅰ. Issue Description

服务接口加入工作流activite后,个别服务报Duplicate entry 'xxx' for key 'lock_table.PRIMARY'

Ⅱ. Describe what happened

client侧:

2024-03-23 17:28:17.963 [http-nio-9205-exec-5] INFO  io.seata.tm.api.TransactionalTemplate - [TID: N/A] - join into a existing global transaction,xid=172.16.5.40:32495:4089735594110024796
2024-03-23 17:28:20.202 [http-nio-9205-exec-5] INFO  c.f.b.c.h.identity.BpmIdentityExtractServiceImpl - [TID: N/A] - [com.finstone.bpmx.core.model.identity.DefaultBpmIdentity@36ebfc]
2024-03-23 17:28:20.210 [http-nio-9205-exec-5] INFO  c.f.h.c.a.bpm.handle.ApprovalTaskAssignHandler - [TID: N/A] - 分派策略============dk_dksq===UserTask_kflizlo=============
2024-03-23 17:28:24.531 [http-nio-9205-exec-5] INFO  c.f.h.c.a.bpm.service.FlowsOperationServiceImpl - [TID: N/A] - bpm doNext result is [{"status":"0","message":"操作成功: 办理成功"}]
2024-03-23 17:28:24.557 [http-nio-9205-exec-5] INFO  io.seata.tm.api.DefaultGlobalTransaction - [TID: N/A] - transaction 172.16.5.40:32495:4089735594110024796 will be rollback
2024-03-23 17:28:24.620 [http-nio-9205-exec-5] INFO  io.seata.tm.api.DefaultGlobalTransaction - [TID: N/A] - transaction end, xid = 172.16.5.40:32495:4089735594110024796
2024-03-23 17:28:24.621 [http-nio-9205-exec-5] INFO  io.seata.tm.api.DefaultGlobalTransaction - [TID: N/A] - [172.16.5.40:32495:4089735594110024796] rollback status: Rollbacked
2024-03-23 17:28:24.627 [http-nio-9205-exec-5] ERROR c.f.f.web.support.FusionGlobalExceptionHandler - [TID: N/A] - try to proceed invocation error
java.lang.RuntimeException: try to proceed invocation error
	at io.seata.spring.annotation.AdapterInvocationWrapper.proceed(AdapterInvocationWrapper.java:59)
	at io.seata.integration.tx.api.interceptor.handler.GlobalTransactionalInterceptorHandler$2.execute(GlobalTransactionalInterceptorHandler.java:200)
	at io.seata.tm.api.TransactionalTemplate.execute(TransactionalTemplate.java:128)
	at io.seata.integration.tx.api.interceptor.handler.GlobalTransactionalInterceptorHandler.handleGlobalTransaction(GlobalTransactionalInterceptorHandler.java:197)
	at io.seata.integration.tx.api.interceptor.handler.GlobalTransactionalInterceptorHandler.doInvoke(GlobalTransactionalInterceptorHandler.java:166)
	at io.seata.integration.tx.api.interceptor.handler.AbstractProxyInvocationHandler.invoke(AbstractProxyInvocationHandler.java:35)
	at io.seata.spring.annotation.AdapterSpringSeataInterceptor.invoke(AdapterSpringSeataInterceptor.java:45)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753)
	at com.alibaba.druid.support.spring.stat.DruidStatInterceptor.invoke(DruidStatInterceptor.java:73)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753)
	at com.finstone.fusion.logging.aop.AccessLoggerInterceptor.invoke(AccessLoggerInterceptor.java:117)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753)
	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:698)
	at com.finstone.hfmis.center.approval.bpm.service.FlowsOperationServiceImpl$$EnhancerBySpringCGLIB$$53218f6b.doNext(<generated>)
	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:498)
	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
	at com.finstone.fusion.service.core.proxy.FeignProxyMethodInterceptor.invoke(FeignProxyMethodInterceptor.java:13)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:215)
	at com.sun.proxy.$Proxy193.doNext(Unknown Source)
	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:498)
	at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)
	at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150)
	at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117)
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895)
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808)
	at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1067)
	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:963)
	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
	at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:681)
	at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:764)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
	at com.github.xiaoymin.swaggerbootstrapui.filter.ProductionSecurityFilter.doFilter(ProductionSecurityFilter.java:53)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:103)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
	at com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.java:124)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
	at com.finstone.fusion.web.filter.FusionDataExportFilter.doFilterInternal(FusionDataExportFilter.java:37)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:327)
	at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:115)
	at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:81)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
	at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:119)
	at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
	at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:126)
	at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:81)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
	at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:105)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
	at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:149)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
	at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
	at com.finstone.fusion.auth.filter.UserTenantHolderFilter.doFilterInternal(UserTenantHolderFilter.java:50)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
	at com.finstone.fusion.auth.filter.SessionUserHolderFilter.doFilterInternal(SessionUserHolderFilter.java:52)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
	at org.springframework.security.oauth2.provider.authentication.OAuth2AuthenticationProcessingFilter.doFilter(OAuth2AuthenticationProcessingFilter.java:182)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
	at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:103)
	at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:89)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
	at org.springframework.web.filter.CorsFilter.doFilterInternal(CorsFilter.java:91)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
	at org.springframework.security.web.header.HeaderWriterFilter.doHeadersAfter(HeaderWriterFilter.java:90)
	at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:75)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
	at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:110)
	at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:80)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
	at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:55)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
	at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:211)
	at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:183)
	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:358)
	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:271)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
	at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
	at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
	at com.finstone.fusion.security.web.filter.SignResponseFilter.doFilter(SignResponseFilter.java:34)
	at com.finstone.fusion.core.web.filter.AbstractFilter.doFilterInternal(AbstractFilter.java:56)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
	at com.finstone.fusion.bsp.nbpm.filter.BpmCleanUpFilter.doFilterInternal(BpmCleanUpFilter.java:24)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
	at com.finstone.fusion.web.filter.FusionContextFilter.doFilterInternal(FusionContextFilter.java:33)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
	at com.finstone.fusion.web.filter.FusionContextHolderFilter.doFilterInternal(FusionContextHolderFilter.java:38)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
	at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.doFilterInternal(WebMvcMetricsFilter.java:97)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
	at com.thetransactioncompany.cors.CORSFilter.doFilter(CORSFilter.java:209)
	at com.thetransactioncompany.cors.CORSFilter.doFilter(CORSFilter.java:244)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:197)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:540)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:357)
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:382)
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:895)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1722)
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
	at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
	at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:748)
Caused by: org.springframework.transaction.TransactionSystemException: JDBC commit failed; nested exception is java.sql.SQLException: io.seata.core.exception.RmTransactionException: branch register failed, xid: 172.16.5.40:32495:4089735594110024796, errMsg: TransactionException[branch register request failed. xid=172.16.5.40:32495:4089735594110024796, msg=Duplicate entry 'jdbc:oceanbase:oracle://172.16.5.50:2883/HFMIS_V10/HFMIS_V10^^^d' for key 'lock_table.PRIMARY'] 
	at org.springframework.jdbc.datasource.DataSourceTransactionManager.translateException(DataSourceTransactionManager.java:435)
	at org.springframework.jdbc.support.JdbcTransactionManager.translateException(JdbcTransactionManager.java:188)
	at org.springframework.jdbc.datasource.DataSourceTransactionManager.doCommit(DataSourceTransactionManager.java:336)
	at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:743)
	at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:711)
	at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:654)
	at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:407)
	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753)
	at io.seata.spring.annotation.AdapterInvocationWrapper.proceed(AdapterInvocationWrapper.java:57)
	... 161 common frames omitted
Caused by: java.sql.SQLException: io.seata.core.exception.RmTransactionException: branch register failed, xid: 172.16.5.40:32495:4089735594110024796, errMsg: TransactionException[branch register request failed. xid=172.16.5.40:32495:4089735594110024796, msg=Duplicate entry 'jdbc:oceanbase:oracle://172.16.5.50:2883/HFMIS_V10/HFMIS_V10^^^d' for key 'lock_table.PRIMARY'] 
	at io.seata.rm.datasource.ConnectionProxy.recognizeLockKeyConflictException(ConnectionProxy.java:161)
	at io.seata.rm.datasource.ConnectionProxy.processGlobalTransactionCommit(ConnectionProxy.java:252)
	at io.seata.rm.datasource.ConnectionProxy.doCommit(ConnectionProxy.java:230)
	at io.seata.rm.datasource.ConnectionProxy.lambda$commit$0(ConnectionProxy.java:188)
	at io.seata.rm.datasource.ConnectionProxy$LockRetryPolicy.doRetryOnLockConflict(ConnectionProxy.java:356)
	at io.seata.rm.datasource.ConnectionProxy$LockRetryPolicy.execute(ConnectionProxy.java:348)
	at io.seata.rm.datasource.ConnectionProxy.commit(ConnectionProxy.java:187)
	at org.springframework.jdbc.datasource.DataSourceTransactionManager.doCommit(DataSourceTransactionManager.java:333)
	... 169 common frames omitted
Caused by: io.seata.core.exception.RmTransactionException: branch register failed, xid: 172.16.5.40:32495:4089735594110024796, errMsg: TransactionException[branch register request failed. xid=172.16.5.40:32495:4089735594110024796, msg=Duplicate entry 'jdbc:oceanbase:oracle://172.16.5.50:2883/HFMIS_V10/HFMIS_V10^^^d' for key 'lock_table.PRIMARY'] 
	at io.seata.rm.AbstractResourceManager.branchRegister(AbstractResourceManager.java:70)
	at io.seata.rm.DefaultResourceManager.branchRegister(DefaultResourceManager.java:96)
	at io.seata.rm.datasource.ConnectionProxy.register(ConnectionProxy.java:273)
	at io.seata.rm.datasource.ConnectionProxy.processGlobalTransactionCommit(ConnectionProxy.java:250)
	... 175 common frames omitted

TC侧:

17:28:17.168  INFO --- [verHandlerThread_1_46_500] [rocessor.server.RegRmProcessor] [      onRegRmMessage]  [] : RM register success,message:RegisterRMRequest{resourceIds='jdbc:oceanbase:oracle://172.16.5.50:2883/HFMIS_V10/HFMIS_V10', version='2.0.0.1-SNAPSHOT', applicationId='h10-cloud-app-business', transactionServiceGroup='default_tx_group', extraData='null'},channel:[id: 0xd88342a7, L:/10.233.97.129:32495 - R:/10.233.98.0:33273],client version:2.0.0.1-SNAPSHOT

 17:28:19.188  INFO --- [     batchLoggerPrint_1_1] [ocessor.server.BatchLogHandler] [                 run]  [] : receive msg[merged]: BranchRegisterRequest{xid='172.16.5.40:32495:4089735594110024796', branchType=AT, resourceId='jdbc:oceanbase:oracle://172.16.5.50:2883/HFMIS_V10/HFMIS_V10', lockKey='HPF_HANDLE_DATA:1765714163054202881', applicationData='null'}, clientIp: 10.233.98.0, vgroup: default_tx_group

 17:28:19.194  INFO --- [               Thread-420] [erver.coordinator.AbstractCore] [bda$branchRegister$0]  [172.16.5.40:32495:4089735594110024796] : Register branch successfully, xid = 172.16.5.40:32495:4089735594110024796, branchId = 4089735594110024857, resourceId = jdbc:oceanbase:oracle://172.16.5.50:2883/HFMIS_V10/HFMIS_V10 ,lockKeys = HPF_HANDLE_DATA:1765714163054202881

 17:28:19.194  INFO --- [     batchLoggerPrint_1_1] [ocessor.server.BatchLogHandler] [                 run]  [] : result msg[merged]: BranchRegisterResponse{branchId=4089735594110024857, resultCode=Success, msg='null'}, clientIp: 10.233.98.0, vgroup: default_tx_group

 17:28:23.294  INFO --- [     batchLoggerPrint_1_1] [ocessor.server.BatchLogHandler] [                 run]  [] : receive msg[merged]: BranchRegisterRequest{xid='172.16.5.40:32495:4089735594110024796', branchType=AT, resourceId='jdbc:oceanbase:oracle://172.16.5.50:2883/HFMIS_V10/HFMIS_V10', lockKey='dk_sq:pmls_sqbh_020240307002_1765712892607909889;bpm_pro_status:1770690418579091456;ACT_HI_VARINST:1766363393190948864;ACT_HI_VARINST:1766363393098674176;bpm_exe_stack:1771411213675397120;ACT_HI_VARINST:1766363393207726080;bpm_check_opinion:1771469015512059904;ACT_HI_VARINST:1766363393123840000;bpm_exe_stack_executor:1771469015717580801;bpm_pro_status:1767739386380599296;ACT_HI_VARINST:1766363393081896960;ACT_HI_VARINST:1766363393140617216;ACT_HI_VARINST:1766363392993816576;ACT_HI_VARINST:1766363393174171648;ACT_HI_VARINST:1766363393149005824;bpm_task:1771469015147155457;ACT_HI_VARINST:1766363393199337472;ACT_HI_VARINST:1766363392951873536;bpm_pro_inst:1766363390070386688;ACT_HI_TASKINST:1771469015147155457;ACT_HI_VARINST:1766363393035759616;ACT_HI_VARINST:1766363393018982400;ACT_HI_VARINST:1766363393115451392;ACT_HI_VARINST:1766363393073508352;ACT_HI_VARINST:1766363393182560256;bpm_exe_stack:1771469015642083328;ACT_HI_VARINST:1766363393132228608;ACT_HI_VARINST:1766363393107062784;bpm_check_opinion:1771411213612482560;bpm_task:1771411213398573057;ACT_HI_VARINST:1766363393052536832;ACT_RU_EXECUTION:1766363392851210240;ACT_HI_TASKINST:1771411213398573057;ACT_HI_VARINST:1766363392985427968;ACT_HI_VARINST:1766363393090285568;ACT_HI_VARINST:1766363393027371008;bpm_exe_stack_executor:1771411213708951552;ACT_HI_VARINST:1766363392943484928;ACT_RU_TASK:1771469015147155457;ACT_HI_VARINST:1766363393002205184;ACT_HI_VARINST:1766363393065119744;bpm_exe_stack_relation:1771469015679832064;ACT_HI_ACTINST:1771411213398573056;ACT_HI_VARINST:1766363393010593792;ACT_HI_VARINST:1766363392964456448;ACT_HI_VARINST:1766363392935096321;ACT_HI_VARINST:1766363393157394432;ACT_HI_ACTINST:1771469015147155456;ACT_HI_VARINST:1766363392851210241;ACT_HI_VARINST:1766363392977039360;ACT_RU_TASK:1771411213398573057;ACT_HI_VARINST:1766363393165783040;ACT_HI_VARINST:1766363393044148224', applicationData='{"autoCommit":false}'}, clientIp: 10.233.98.0, vgroup: default_tx_group

 17:28:23.306 ERROR --- [               Thread-421] [ption.AbstractExceptionHandler] [eptionHandleTemplate]  [172.16.5.40:32495:4089735594110024796] : Catch TransactionException while do RPC, request: BranchRegisterRequest{xid='172.16.5.40:32495:4089735594110024796', branchType=AT, resourceId='jdbc:oceanbase:oracle://172.16.5.50:2883/HFMIS_V10/HFMIS_V10', lockKey='dk_sq:pmls_sqbh_020240307002_1765712892607909889;bpm_pro_status:1770690418579091456;ACT_HI_VARINST:1766363393190948864;ACT_HI_VARINST:1766363393098674176;bpm_exe_stack:1771411213675397120;ACT_HI_VARINST:1766363393207726080;bpm_check_opinion:1771469015512059904;ACT_HI_VARINST:1766363393123840000;bpm_exe_stack_executor:1771469015717580801;bpm_pro_status:1767739386380599296;ACT_HI_VARINST:1766363393081896960;ACT_HI_VARINST:1766363393140617216;ACT_HI_VARINST:1766363392993816576;ACT_HI_VARINST:1766363393174171648;ACT_HI_VARINST:1766363393149005824;bpm_task:1771469015147155457;ACT_HI_VARINST:1766363393199337472;ACT_HI_VARINST:1766363392951873536;bpm_pro_inst:1766363390070386688;ACT_HI_TASKINST:1771469015147155457;ACT_HI_VARINST:1766363393035759616;ACT_HI_VARINST:1766363393018982400;ACT_HI_VARINST:1766363393115451392;ACT_HI_VARINST:1766363393073508352;ACT_HI_VARINST:1766363393182560256;bpm_exe_stack:1771469015642083328;ACT_HI_VARINST:1766363393132228608;ACT_HI_VARINST:1766363393107062784;bpm_check_opinion:1771411213612482560;bpm_task:1771411213398573057;ACT_HI_VARINST:1766363393052536832;ACT_RU_EXECUTION:1766363392851210240;ACT_HI_TASKINST:1771411213398573057;ACT_HI_VARINST:1766363392985427968;ACT_HI_VARINST:1766363393090285568;ACT_HI_VARINST:1766363393027371008;bpm_exe_stack_executor:1771411213708951552;ACT_HI_VARINST:1766363392943484928;ACT_RU_TASK:1771469015147155457;ACT_HI_VARINST:1766363393002205184;ACT_HI_VARINST:1766363393065119744;bpm_exe_stack_relation:1771469015679832064;ACT_HI_ACTINST:1771411213398573056;ACT_HI_VARINST:1766363393010593792;ACT_HI_VARINST:1766363392964456448;ACT_HI_VARINST:1766363392935096321;ACT_HI_VARINST:1766363393157394432;ACT_HI_ACTINST:1771469015147155456;ACT_HI_VARINST:1766363392851210241;ACT_HI_VARINST:1766363392977039360;ACT_RU_TASK:1771411213398573057;ACT_HI_VARINST:1766363393165783040;ACT_HI_VARINST:1766363393044148224', applicationData='{"autoCommit":false}'}

 ==>

 io.seata.core.exception.TransactionException: branch register request failed. xid=172.16.5.40:32495:4089735594110024796, msg=Duplicate entry 'jdbc:oceanbase:oracle://172.16.5.50:2883/HFMIS_V10/HFMIS_V10^^^d' for key 'lock_table.PRIMARY'

 	at io.seata.server.AbstractTCInboundHandler$4.execute(AbstractTCInboundHandler.java:187) ~[classes/:na]

 	at io.seata.server.AbstractTCInboundHandler$4.execute(AbstractTCInboundHandler.java:179) ~[classes/:na]

 	at io.seata.core.exception.AbstractExceptionHandler.exceptionHandleTemplate(AbstractExceptionHandler.java:131) ~[seata-core-2.0.0.1-SNAPSHOT.jar:2.0.0.1-SNAPSHOT]

 	at io.seata.server.AbstractTCInboundHandler.handle(AbstractTCInboundHandler.java:179) [classes/:na]

 	at io.seata.core.protocol.transaction.BranchRegisterRequest.handle(BranchRegisterRequest.java:136) [seata-core-2.0.0.1-SNAPSHOT.jar:2.0.0.1-SNAPSHOT]

 	at io.seata.server.coordinator.DefaultCoordinator.onRequest(DefaultCoordinator.java:523) [classes/:na]

 	at io.seata.core.rpc.processor.server.ServerOnRequestProcessor.handleRequestsByMergedWarpMessage(ServerOnRequestProcessor.java:288) [seata-core-2.0.0.1-SNAPSHOT.jar:2.0.0.1-SNAPSHOT]

 	at io.seata.core.rpc.processor.server.ServerOnRequestProcessor.lambda$onRequestMessage$1(ServerOnRequestProcessor.java:178) [seata-core-2.0.0.1-SNAPSHOT.jar:2.0.0.1-SNAPSHOT]

 	at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1604) ~[na:1.8.0_342]

 	at java.lang.Thread.run(Thread.java:750) ~[na:1.8.0_342]

 Caused by: io.seata.common.exception.StoreException: Duplicate entry 'jdbc:oceanbase:oracle://172.16.5.50:2883/HFMIS_V10/HFMIS_V10^^^d' for key 'lock_table.PRIMARY'

 	at io.seata.server.storage.db.lock.LockStoreDataBaseDAO.acquireLock(LockStoreDataBaseDAO.java:199) ~[classes/:na]

 	at io.seata.server.storage.db.lock.DataBaseLocker.acquireLock(DataBaseLocker.java:64) ~[classes/:na]

 	at io.seata.server.lock.AbstractLockManager.acquireLock(AbstractLockManager.java:65) ~[classes/:na]

 	at io.seata.server.session.BranchSession.lock(BranchSession.java:300) ~[classes/:na]

 	at io.seata.server.transaction.at.ATCore.branchSessionLock(ATCore.java:77) ~[classes/:na]

 	at io.seata.server.coordinator.AbstractCore.lambda$branchRegister$0(AbstractCore.java:82) ~[classes/:na]

 	at io.seata.server.storage.db.session.DataBaseSessionManager.lockAndExecute(DataBaseSessionManager.java:153) ~[classes/:na]

 	at io.seata.server.session.SessionHolder.lockAndExecute(SessionHolder.java:332) ~[classes/:na]

 	at io.seata.server.coordinator.AbstractCore.branchRegister(AbstractCore.java:77) ~[classes/:na]

 	at io.seata.server.coordinator.DefaultCore.branchRegister(DefaultCore.java:107) ~[classes/:na]

 	at io.seata.server.coordinator.DefaultCoordinator.doBranchRegister(DefaultCoordinator.java:299) [classes/:na]

 	at io.seata.server.AbstractTCInboundHandler$4.execute(AbstractTCInboundHandler.java:184) ~[classes/:na]

 	... 9 common frames omitted

 Caused by: java.sql.BatchUpdateException: Duplicate entry 'jdbc:oceanbase:oracle://172.16.5.50:2883/HFMIS_V10/HFMIS_V10^^^d' for key 'lock_table.PRIMARY'

 	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_342]

 	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:1.8.0_342]

 	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.8.0_342]

 	at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[na:1.8.0_342]

 	at com.mysql.cj.util.Util.handleNewInstance(Util.java:192) ~[na:na]

 	at com.mysql.cj.util.Util.getInstance(Util.java:167) ~[na:na]

 	at com.mysql.cj.util.Util.getInstance(Util.java:174) ~[na:na]

 	at com.mysql.cj.jdbc.exceptions.SQLError.createBatchUpdateException(SQLError.java:224) ~[na:na]

 	at com.mysql.cj.jdbc.ClientPreparedStatement.executeBatchedInserts(ClientPreparedStatement.java:755) ~[na:na]

 	at com.mysql.cj.jdbc.ClientPreparedStatement.executeBatchInternal(ClientPreparedStatement.java:426) ~[na:na]

 	at com.mysql.cj.jdbc.StatementImpl.executeBatch(StatementImpl.java:800) ~[na:na]

 	at com.alibaba.druid.pool.DruidPooledPreparedStatement.executeBatch(DruidPooledPreparedStatement.java:565) ~[druid-1.2.7.jar:1.2.7]

 	at io.seata.server.storage.db.lock.LockStoreDataBaseDAO.doAcquireLocks(LockStoreDataBaseDAO.java:371) ~[classes/:na]

 	at io.seata.server.storage.db.lock.LockStoreDataBaseDAO.acquireLock(LockStoreDataBaseDAO.java:187) ~[classes/:na]

 	... 20 common frames omitted

 Caused by: java.sql.SQLIntegrityConstraintViolationException: Duplicate entry 'jdbc:oceanbase:oracle://172.16.5.50:2883/HFMIS_V10/HFMIS_V10^^^d' for key 'lock_table.PRIMARY'

 	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:117) ~[na:na]

 	at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122) ~[na:na]

 	at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:953) ~[na:na]

 	at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1098) ~[na:na]

 	at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1046) ~[na:na]

 	at com.mysql.cj.jdbc.ClientPreparedStatement.executeLargeUpdate(ClientPreparedStatement.java:1371) ~[na:na]

 	at com.mysql.cj.jdbc.ClientPreparedStatement.executeBatchedInserts(ClientPreparedStatement.java:716) ~[na:na]

 	... 25 common frames omitted

 <==

 

 17:28:23.307  INFO --- [     batchLoggerPrint_1_1] [ocessor.server.BatchLogHandler] [                 run]  [] : result msg[merged]: BranchRegisterResponse{branchId=0, resultCode=Failed, msg='TransactionException[branch register request failed. xid=172.16.5.40:32495:4089735594110024796, msg=Duplicate entry 'jdbc:oceanbase:oracle://172.16.5.50:2883/HFMIS_V10/HFMIS_V10^^^d' for key 'lock_table.PRIMARY']'}, clientIp: 10.233.98.0, vgroup: default_tx_group

 17:28:23.318  INFO --- [     batchLoggerPrint_1_1] [ocessor.server.BatchLogHandler] [                 run]  [] : receive msg[single]: GlobalRollbackRequest{xid='172.16.5.40:32495:4089735594110024796', extraData='null'}, clientIp: 10.233.98.0, vgroup: default_tx_group

 17:28:23.354  INFO --- [     batchLoggerPrint_1_1] [ocessor.server.BatchLogHandler] [                 run]  [] : receive msg[single]: BranchRollbackResponse{xid='172.16.5.40:32495:4089735594110024796', branchId=4089735594110024809, branchStatus=PhaseTwo_Rollbacked, resultCode=Success, msg='null'}, clientIp: 10.233.98.0, vgroup: default_tx_group

 17:28:23.361  INFO --- [verHandlerThread_1_49_500] [server.coordinator.DefaultCore] [a$doGlobalRollback$3]  [172.16.5.40:32495:4089735594110024796] : Rollback branch transaction successfully, xid = 172.16.5.40:32495:4089735594110024796 branchId = 4089735594110024809

 17:28:23.376  INFO --- [     batchLoggerPrint_1_1] [ocessor.server.BatchLogHandler] [                 run]  [] : receive msg[single]: BranchRollbackResponse{xid='172.16.5.40:32495:4089735594110024796', branchId=4089735594110024857, branchStatus=PhaseTwo_Rollbacked, resultCode=Success, msg='null'}, clientIp: 10.233.98.0, vgroup: default_tx_group

 17:28:23.379  INFO --- [verHandlerThread_1_49_500] [server.coordinator.DefaultCore] [a$doGlobalRollback$3]  [172.16.5.40:32495:4089735594110024796] : Rollback branch transaction successfully, xid = 172.16.5.40:32495:4089735594110024796 branchId = 4089735594110024857

 17:28:23.380  INFO --- [verHandlerThread_1_49_500] [server.coordinator.DefaultCore] [    doGlobalRollback]  [172.16.5.40:32495:4089735594110024796] : Rollback global transaction successfully, xid = 172.16.5.40:32495:4089735594110024796.

 17:28:23.381  INFO --- [     batchLoggerPrint_1_1] [ocessor.server.BatchLogHandler] [                 run]  [] : result msg[single]: GlobalRollbackResponse{globalStatus=Rollbacked, resultCode=Success, msg='null'}, clientIp: 10.233.98.0, vgroup: default_tx_group

 17:28:23.397  INFO --- [ettyServerNIOWorker_1_1_4] [rocessor.server.RegTmProcessor] [      onRegTmMessage]  [] : TM register success,message:RegisterTMRequest{version='2.0.0.1-SNAPSHOT', applicationId='h10-cloud-app-business', transactionServiceGroup='default_tx_group', extraData='ak=null

 digest=default_tx_group,192.168.31.216,1711186104632

 timestamp=1711186104632

Ⅵ. Environment:

  • JDK version(e.g. java -version ): 1.8
  • Seata client/server version: 2.0.0,我在seata2.0.0的基础上做了二开,兼容了OceanBase,
  • Database version: 业务库OceanBase, seata服务端mysql
  • OS(e.g. uname -a ):
  • Others:
91zkwejq

91zkwejq1#

You can check the locking xid from the database. It is a normal phenomenon for concurrent transactions that modify the same data to hold locks.

hrirmatl

hrirmatl2#

You can check the locking xid from the database. It is a normal phenomenon for concurrent transactions that modify the same data to hold locks.

您是说两个分支事务修改相同的数据,就会导致lock_table的主键冲突?

hrysbysz

hrysbysz3#

You can check the locking xid from the database. It is a normal phenomenon for concurrent transactions that modify the same data to hold locks.

您是说两个分支事务修改相同的数据,就会导致lock_table的主键冲突?

我试了下,两个事务操作同一条数据,lock_table是不会有主键冲突的。

rkkpypqq

rkkpypqq4#

You can check the locking xid from the database. It is a normal phenomenon for concurrent transactions that modify the same data to hold locks.

您是说两个分支事务修改相同的数据,就会导致lock_table的主键冲突?

two branch transactions under different xids that have modified data with the same primary key id.

kqqjbcuj

kqqjbcuj5#

You can check the locking xid from the database. It is a normal phenomenon for concurrent transactions that modify the same data to hold locks.

您是说两个分支事务修改相同的数据,就会导致lock_table的主键冲突?

two branch transactions under different xids that have modified data with the same primary key id.

The different xids? 两个全局事务,操作同一张表的同一条数据,会提示全局锁冲突吧?

htrmnn0y

htrmnn0y6#

@slievrly 大佬大佬,还有其它原因么?

a64a0gku

a64a0gku7#

Is the same data reentered multiple times under the same xid?

相关问题