You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@seata.apache.org by "Romic77 (via GitHub)" <gi...@apache.org> on 2024/04/07 05:28:16 UTC
[I] [bug]seata Invalid [incubator-seata]
Romic77 opened a new issue, #6467:
URL: https://github.com/apache/incubator-seata/issues/6467
<!-- Please do not use this issue template to report security vulnerabilities but refer to our [security policy](https://github.com/seata/seata/security/policy). -->
- [ ] I have searched the [issues](https://github.com/seata/seata/issues) of this repository and believe that this is not a duplicate.
### Ⅰ. Issue Description
seata invalid
```
<spring.boot.version>3.2.0</spring.boot.version>
<spring.cloud.version>2023.0.0</spring.cloud.version>
<spring.cloud.alibaba.version>2023.0.0.0-RC1</spring.cloud.alibaba.version>
```
## pom
```
<!--alibaba-seata-->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-seata</artifactId>
</dependency>
```
## yml
```
# ========================seata===================
seata:
registry:
type: nacos
nacos:
server-addr: ${common.nacos.server}
namespace: ${common.nacos.namespace}
group: DEFAULT_GROUP
application: seata-server
tx-service-group: default_tx_group # 事务组,由它获得TC服务的集群名称
service:
vgroup-mapping: # 点击源码分析
default_tx_group: default # 事务组与TC服务集群的映射关系
data-source-proxy-mode: AT
```
## cloud-order
```
@GlobalTransactional(rollbackFor = Exception.class)
@Override
public void saveOrder(OrderDTO orderDTO) {
log.info("Seata全局事务id=================>{}", RootContext.getXID());
OrderEntity orderEntity = new OrderEntity();
BeanUtil.copyProperties(orderDTO, orderEntity, "id");
orderEntity.setOrderNo(IdUtil.fastSimpleUUID());
save(orderEntity);
PayDTO payDTO = new PayDTO();
payDTO.setOrderNo(orderEntity.getOrderNo());
payDTO.setPayNo(IdUtil.fastSimpleUUID());
payDTO.setAmount(orderEntity.getMoney());
remotePayService.save(payDTO);
}
```
### log
```
2024-04-07 13:20:18.986 INFO 25956 --- [TID: N/A] [cloud-order] http-nio-8084-exec-4 i.seata.tm.api.DefaultGlobalTransaction Line:117 : Begin new global transaction [192.168.5.162:8091:2396423015185461306]
2024-04-07 13:20:18.986 INFO 25956 --- [TID: N/A] [cloud-order] http-nio-8084-exec-4 o.e.order.service.impl.OrderServiceImpl Line:37 : Seata全局事务id=================>192.168.5.162:8091:2396423015185461306
2024-04-07 13:20:18.989 DEBUG 25956 --- [TID: N/A] [cloud-order] http-nio-8084-exec-4 o.e.order.mapper.OrderMapper.insert Line:137 : ==> Preparing: INSERT INTO t_order ( user_id, order_no, product_id, count, money ) VALUES ( ?, ?, ?, ?, ? )
2024-04-07 13:20:18.990 DEBUG 25956 --- [TID: N/A] [cloud-order] http-nio-8084-exec-4 o.e.order.mapper.OrderMapper.insert Line:137 : ==> Parameters: 123(Long), 3a156ec6148d4513be22f8da0425481a(String), 2(BigDecimal), 1(Integer), 22(BigDecimal)
2024-04-07 13:20:19.000 INFO 25956 --- [TID: N/A] [cloud-order] http-nio-8084-exec-4 io.seata.rm.AbstractResourceManager Line:73 : branch register success, xid:192.168.5.162:8091:2396423015185461306, branchId:2396423015185461307, lockKeys:t_order:124
2024-04-07 13:20:19.033 DEBUG 25956 --- [TID: N/A] [cloud-order] http-nio-8084-exec-4 o.e.order.mapper.OrderMapper.insert Line:137 : <== Updates: 1
2024-04-07 13:20:19.252 INFO 25956 --- [TID: N/A] [cloud-order] http-nio-8084-exec-4 i.seata.tm.api.DefaultGlobalTransaction Line:133 : transaction 192.168.5.162:8091:2396423015185461306 will be commit
2024-04-07 13:20:19.255 INFO 25956 --- [TID: N/A] [cloud-order] http-nio-8084-exec-4 i.seata.tm.api.DefaultGlobalTransaction Line:210 : transaction end, xid = 192.168.5.162:8091:2396423015185461306
2024-04-07 13:20:19.255 INFO 25956 --- [TID: N/A] [cloud-order] http-nio-8084-exec-4 i.seata.tm.api.DefaultGlobalTransaction Line:155 : [192.168.5.162:8091:2396423015185461306] commit status: Committed
2024-04-07 13:20:19.632 INFO 25956 --- [TID: N/A] [cloud-order] rpcDispatch_RMROLE_1_3_32 i.s.c.r.p.c.RmBranchCommitProcessor Line:56 : rm client handle branch commit process:BranchCommitRequest{xid='192.168.5.162:8091:2396423015185461306', branchId=2396423015185461307, branchType=AT, resourceId='jdbc:mysql://xxx:3306/db_order', applicationData='{"skipCheckLock":true}'}
2024-04-07 13:20:19.632 INFO 25956 --- [TID: N/A] [cloud-order] rpcDispatch_RMROLE_1_3_32 io.seata.rm.AbstractRMHandler Line:96 : Branch committing: 192.168.5.162:8091:2396423015185461306 2396423015185461307 jdbc:mysql://xxx:3306/db_order {"skipCheckLock":true}
2024-04-07 13:20:19.632 INFO 25956 --- [TID: N/A] [cloud-order] rpcDispatch_RMROLE_1_3_32 io.seata.rm.AbstractRMHandler Line:104 : Branch commit result: PhaseTwo_Committed
```
## cloud-pay
```
@Override
public void savePay(PayDTO payDTO) {
log.info("Seata全局事务id=================>{}", RootContext.getXID());
PayEntity payEntity = new PayEntity();
BeanUtil.copyProperties(payDTO, payEntity, "id");
int i = 1 / 0;
save(payEntity);
}
```
### log
```
2024-04-07 13:20:19.195 INFO 33900 --- [TID: N/A] [cloud-pay] http-nio-8082-exec-1 o.e.pay.service.impl.PayServiceImpl Line:35 : Seata全局事务id=================>192.168.5.162:8091:2396423015185461306
2024-04-07 13:20:19.234 ERROR 33900 --- [TID: N/A] [cloud-pay] http-nio-8082-exec-1 o.e.exception.GlobalExceptionHandler Line:196 : 程序异常,异常原因:
java.lang.ArithmeticException: / by zero
at org.example.pay.service.impl.PayServiceImpl.savePay(PayServiceImpl.java:38)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:352)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:713)
at org.example.pay.service.impl.PayServiceImpl$$SpringCGLIB$$0.savePay(<generated>)
at org.example.pay.controller.PayController.save(PayController.java:37)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:254)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:182)
```
GlobalTransactional Not work;
cloud-order xid Seata全局事务id=================>192.168.5.162:8091:2396423015185461306
cloud-pay xid Seata全局事务id=================>192.168.5.162:8091:2396423015185461306
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [I] [bug]seata Invalid [incubator-seata]
Posted by "funky-eyes (via GitHub)" <gi...@apache.org>.
funky-eyes closed issue #6467: [bug]seata Invalid
URL: https://github.com/apache/incubator-seata/issues/6467
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [I] [bug]seata Invalid [incubator-seata]
Posted by "funky-eyes (via GitHub)" <gi...@apache.org>.
funky-eyes commented on issue #6467:
URL: https://github.com/apache/incubator-seata/issues/6467#issuecomment-2041320879
GlobalExceptionHandler
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org