查询oracle是否开启xa,XA模式,Oracle数据源,多个服务不能操作同一数据库?

这篇博客记录了一次Seata在整合Oracle数据库时遇到的全局事务ID异常,具体表现为Spring Transaction创建交易失败,原因在于尝试连接分布式事务资源时发生资源管理器错误。文中详细分析了异常堆栈,包括SQLException和Oracle错误码,以及Seata RM(Resource Manager)处理过程。
摘要由CSDN通过智能技术生成

same problem

全局事务id :192.168.202.58:8091:69346279655972864

2020-11-10 08:37:21.480 ERROR 20012 --- [:20881-thread-8] o.a.dubbo.rpc.filter.ExceptionFilter : [DUBBO] Got unchecked and undeclared exception which called by 192.168.202.58. service: io.seata.samples.integration.common.dubbo.OrderDubboService, method: createOrder, exception: org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is java.sql.SQLException: failed to start xa branch 192.168.202.58:8091:69346279655972864 since XAErr (-3): A resource manager error has occured in the transaction branch. ORA-2079 SQLErr (0), dubbo version: 2.7.7, current host: 192.168.202.58

org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is java.sql.SQLException: failed to start xa branch 192.168.202.58:8091:69346279655972864 since XAErr (-3): A resource manager error has occured in the transaction branch. ORA-2079 SQLErr (0)

at org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:305) ~[spring-jdbc-5.2.8.RELEASE.jar:5.2.8.RELEASE]

at org.springframework.transaction.support.AbstractPlatformTransactionManager.startTransaction(AbstractPlatformTransactionManager.java:400) ~[spring-tx-5.2.8.RELEASE.jar:5.2.8.RELEASE]

at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:373) ~[spring-tx-5.2.8.RELEASE.jar:5.2.8.RELEASE]

at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:574) ~[spring-tx-5.2.8.RELEASE.jar:5.2.8.RELEASE]

at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:361) ~[spring-tx-5.2.8.RELEASE.jar:5.2.8.RELEASE]

at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:118) ~[spring-tx-5.2.8.RELEASE.jar:5.2.8.RELEASE]

at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.2.8.RELEASE.jar:5.2.8.RELEASE]

at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749) ~[spring-aop-5.2.8.RELEASE.jar:5.2.8.RELEASE]

at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:691) ~[spring-aop-5.2.8.RELEASE.jar:5.2.8.RELEASE]

at io.seata.samples.integration.order.service.TOrderServiceImpl$$EnhancerBySpringCGLIB$$483b7dbd.createOrder() ~[classes/:na]

at io.seata.samples.integration.order.dubbo.OrderDubboServiceImpl.createOrder(OrderDubboServiceImpl.java:27) ~[classes/:na]

at org.apache.dubbo.common.bytecode.Wrapper2.invokeMethod(Wrapper2.java) ~[dubbo-2.7.7.jar:2.7.7]

at org.apache.dubbo.rpc.proxy.javassist.JavassistProxyFactory$1.doInvoke(JavassistProxyFactory.java:47) ~[dubbo-2.7.7.jar:2.7.7]

at org.apache.dubbo.rpc.proxy.AbstractProxyInvoker.invoke(AbstractProxyInvoker.java:84) ~[dubbo-2.7.7.jar:2.7.7]

at org.apache.dubbo.config.invoker.DelegateProviderMetaDataInvoker.invoke(DelegateProviderMetaDataInvoker.java:56) ~[dubbo-2.7.7.jar:2.7.7]

at org.apache.dubbo.rpc.protocol.InvokerWrapper.invoke(InvokerWrapper.java:56) ~[dubbo-2.7.7.jar:2.7.7]

at com.alibaba.dubbo.rpc.Invoker$CompatibleInvoker.invoke(Invoker.java:55) ~[dubbo-2.7.7.jar:2.7.7]

at io.seata.integration.dubbo.alibaba.AlibabaDubboTransactionPropagationFilter.invoke(AlibabaDubboTransactionPropagationFilter.java:45) ~[seata-all-1.3.0.jar:1.3.0]

at com.alibaba.dubbo.rpc.Filter.invoke(Filter.java:29) ~[dubbo-2.7.7.jar:2.7.7]

at org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:81) ~[dubbo-2.7.7.jar:2.7.7]

at io.seata.integration.dubbo.ApacheDubboTransactionPropagationFilter.invoke(ApacheDubboTransactionPropagationFilter.java:69) ~[seata-all-1.3.0.jar:1.3.0]

at org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:81) ~[dubbo-2.7.7.jar:2.7.7]

at org.apache.dubbo.rpc.filter.ExceptionFilter.invoke(ExceptionFilter.java:52) ~[dubbo-2.7.7.jar:2.7.7]

at org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:81) ~[dubbo-2.7.7.jar:2.7.7]

at org.apache.dubbo.monitor.support.MonitorFilter.invoke(MonitorFilter.java:89) ~[dubbo-2.7.7.jar:2.7.7]

at org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:81) ~[dubbo-2.7.7.jar:2.7.7]

at org.apache.dubbo.rpc.filter.TimeoutFilter.invoke(TimeoutFilter.java:46) ~[dubbo-2.7.7.jar:2.7.7]

at org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:81) ~[dubbo-2.7.7.jar:2.7.7]

at org.apache.dubbo.rpc.protocol.dubbo.filter.TraceFilter.invoke(TraceFilter.java:77) ~[dubbo-2.7.7.jar:2.7.7]

at org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:81) ~[dubbo-2.7.7.jar:2.7.7]

at org.apache.dubbo.rpc.filter.ContextFilter.invoke(ContextFilter.java:129) ~[dubbo-2.7.7.jar:2.7.7]

at org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:81) ~[dubbo-2.7.7.jar:2.7.7]

at org.apache.dubbo.rpc.filter.GenericFilter.invoke(GenericFilter.java:152) ~[dubbo-2.7.7.jar:2.7.7]

at org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:81) ~[dubbo-2.7.7.jar:2.7.7]

at org.apache.dubbo.rpc.filter.ClassLoaderFilter.invoke(ClassLoaderFilter.java:38) ~[dubbo-2.7.7.jar:2.7.7]

at org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:81) ~[dubbo-2.7.7.jar:2.7.7]

at org.apache.dubbo.rpc.filter.EchoFilter.invoke(EchoFilter.java:41) ~[dubbo-2.7.7.jar:2.7.7]

at org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:81) ~[dubbo-2.7.7.jar:2.7.7]

at org.apache.dubbo.rpc.protocol.dubbo.DubboProtocol$1.reply(DubboProtocol.java:145) ~[dubbo-2.7.7.jar:2.7.7]

at org.apache.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.handleRequest(HeaderExchangeHandler.java:100) ~[dubbo-2.7.7.jar:2.7.7]

at org.apache.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.received(HeaderExchangeHandler.java:175) ~[dubbo-2.7.7.jar:2.7.7]

at org.apache.dubbo.remoting.transport.DecodeHandler.received(DecodeHandler.java:51) ~[dubbo-2.7.7.jar:2.7.7]

at org.apache.dubbo.remoting.transport.dispatcher.ChannelEventRunnable.run(ChannelEventRunnable.java:57) ~[dubbo-2.7.7.jar:2.7.7]

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[na:1.8.0_261]

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[na:1.8.0_261]

at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_261]

Caused by: java.sql.SQLException: failed to start xa branch 192.168.202.58:8091:69346279655972864 since XAErr (-3): A resource manager error has occured in the transaction branch. ORA-2079 SQLErr (0)

at io.seata.rm.datasource.xa.ConnectionProxyXA.setAutoCommit(ConnectionProxyXA.java:146) ~[seata-all-1.3.0.jar:1.3.0]

at org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:283) ~[spring-jdbc-5.2.8.RELEASE.jar:5.2.8.RELEASE]

... 45 common frames omitted

Caused by: oracle.jdbc.xa.OracleXAException: XAErr (-3): A resource manager error has occured in the transaction branch. ORA-2079 SQLErr (0)

at oracle.jdbc.xa.OracleXAResource.checkError(OracleXAResource.java:1114) ~[ojdbc8-19.7.0.0.jar:19.7.0.0.0]

at oracle.jdbc.xa.client.OracleXAResource.start(OracleXAResource.java:267) ~[ojdbc8-19.7.0.0.jar:19.7.0.0.0]

at io.seata.rm.datasource.xa.ConnectionProxyXA.setAutoCommit(ConnectionProxyXA.java:143) ~[seata-all-1.3.0.jar:1.3.0]

... 46 common frames omitted

Caused by: java.sql.SQLSyntaxErrorException: ORA-02079: 无法联接要提交的分布式事务处理

at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:509) ~[ojdbc8-19.7.0.0.jar:19.7.0.0.0]

at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:456) ~[ojdbc8-19.7.0.0.jar:19.7.0.0.0]

at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:451) ~[ojdbc8-19.7.0.0.jar:19.7.0.0.0]

at oracle.jdbc.driver.T4CTTIfun.processError(T4CTTIfun.java:1123) ~[ojdbc8-19.7.0.0.jar:19.7.0.0.0]

at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:553) ~[ojdbc8-19.7.0.0.jar:19.7.0.0.0]

at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:269) ~[ojdbc8-19.7.0.0.jar:19.7.0.0.0]

at oracle.jdbc.driver.T4CTTIOtxse.doOTXSE(T4CTTIOtxse.java:168) ~[ojdbc8-19.7.0.0.jar:19.7.0.0.0]

at oracle.jdbc.driver.T4CXAResource.doStart(T4CXAResource.java:209) ~[ojdbc8-19.7.0.0.jar:19.7.0.0.0]

at oracle.jdbc.xa.client.OracleXAResource.start(OracleXAResource.java:262) ~[ojdbc8-19.7.0.0.jar:19.7.0.0.0]

... 47 common frames omitted

2020-11-10 08:37:21.484 INFO 20012 --- [h_RMROLE_1_3_32] i.s.c.r.p.c.RmBranchRollbackProcessor : rm handle branch rollback process:xid=192.168.202.58:8091:69346279655972864,branchId=69346279710498817,branchType=XA,resourceId=jdbc:oracle:thin:@localhost:1521:XE,applicationData=null

2020-11-10 08:37:21.484 INFO 20012 --- [h_RMROLE_1_3_32] io.seata.rm.AbstractRMHandler : Branch Rollbacking: 192.168.202.58:8091:69346279655972864 69346279710498817 jdbc:oracle:thin:@localhost:1521:XE

2020-11-10 08:37:21.485 INFO 20012 --- [h_RMROLE_1_3_32] i.s.rm.datasource.xa.ResourceManagerXA : 192.168.202.58:8091:69346279655972864-69346279710498817 rollback failed since XAErr (-4): The XID is not valid. ORA-24756 SQLErr (0)

oracle.jdbc.xa.OracleXAException: XAErr (-4): The XID is not valid. ORA-24756 SQLErr (0)

at oracle.jdbc.xa.OracleXAResource.checkError(OracleXAResource.java:1114) ~[ojdbc8-19.7.0.0.jar:19.7.0.0.0]

at oracle.jdbc.xa.client.OracleXAResource.rollback(OracleXAResource.java:1052) ~[ojdbc8-19.7.0.0.jar:19.7.0.0.0]

at io.seata.rm.datasource.xa.ConnectionProxyXA.xaRollback(ConnectionProxyXA.java:108) ~[seata-all-1.3.0.jar:1.3.0]

at io.seata.rm.datasource.xa.ResourceManagerXA.finishBranch(ResourceManagerXA.java:72) [seata-all-1.3.0.jar:1.3.0]

at io.seata.rm.datasource.xa.ResourceManagerXA.branchRollback(ResourceManagerXA.java:58) [seata-all-1.3.0.jar:1.3.0]

at io.seata.rm.AbstractRMHandler.doBranchRollback(AbstractRMHandler.java:125) [seata-all-1.3.0.jar:1.3.0]

at io.seata.rm.AbstractRMHandler$2.execute(AbstractRMHandler.java:67) [seata-all-1.3.0.jar:1.3.0]

at io.seata.rm.AbstractRMHandler$2.execute(AbstractRMHandler.java:63) [seata-all-1.3.0.jar:1.3.0]

at io.seata.core.exception.AbstractExceptionHandler.exceptionHandleTemplate(AbstractExceptionHandler.java:116) [seata-all-1.3.0.jar:1.3.0]

at io.seata.rm.AbstractRMHandler.handle(AbstractRMHandler.java:63) [seata-all-1.3.0.jar:1.3.0]

at io.seata.rm.DefaultRMHandler.handle(DefaultRMHandler.java:63) [seata-all-1.3.0.jar:1.3.0]

at io.seata.core.protocol.transaction.BranchRollbackRequest.handle(BranchRollbackRequest.java:35) [seata-all-1.3.0.jar:1.3.0]

at io.seata.rm.AbstractRMHandler.onRequest(AbstractRMHandler.java:150) [seata-all-1.3.0.jar:1.3.0]

at io.seata.core.rpc.processor.client.RmBranchRollbackProcessor.handleBranchRollback(RmBranchRollbackProcessor.java:63) [seata-all-1.3.0.jar:1.3.0]

at io.seata.core.rpc.processor.client.RmBranchRollbackProcessor.process(RmBranchRollbackProcessor.java:58) [seata-all-1.3.0.jar:1.3.0]

at io.seata.core.rpc.netty.AbstractNettyRemoting.lambda$processMessage$2(AbstractNettyRemoting.java:265) [seata-all-1.3.0.jar:1.3.0]

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[na:1.8.0_261]

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[na:1.8.0_261]

at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[netty-all-4.1.51.Final.jar:4.1.51.Final]

at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_261]

Caused by: java.sql.SQLException: ORA-24756: 事务处理不存在

at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:509) ~[ojdbc8-19.7.0.0.jar:19.7.0.0.0]

at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:456) ~[ojdbc8-19.7.0.0.jar:19.7.0.0.0]

at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:451) ~[ojdbc8-19.7.0.0.jar:19.7.0.0.0]

at oracle.jdbc.driver.T4CTTIfun.processError(T4CTTIfun.java:1123) ~[ojdbc8-19.7.0.0.jar:19.7.0.0.0]

at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:553) ~[ojdbc8-19.7.0.0.jar:19.7.0.0.0]

at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:269) ~[ojdbc8-19.7.0.0.jar:19.7.0.0.0]

at oracle.jdbc.driver.T4CTTIOtxen.doOTXEN(T4CTTIOtxen.java:171) ~[ojdbc8-19.7.0.0.jar:19.7.0.0.0]

at oracle.jdbc.driver.T4CXAResource.doTransaction(T4CXAResource.java:820) ~[ojdbc8-19.7.0.0.jar:19.7.0.0.0]

at oracle.jdbc.driver.T4CXAResource.kputxrec(T4CXAResource.java:888) ~[ojdbc8-19.7.0.0.jar:19.7.0.0.0]

at oracle.jdbc.driver.T4CXAResource.doRollback(T4CXAResource.java:711) ~[ojdbc8-19.7.0.0.jar:19.7.0.0.0]

at oracle.jdbc.xa.client.OracleXAResource.rollback(OracleXAResource.java:1047) ~[ojdbc8-19.7.0.0.jar:19.7.0.0.0]

... 18 common frames omitted

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值