fix:解决版本问题

上级 fbc18c7b
...@@ -13,10 +13,11 @@ public class PersonServiceImpl extends ServiceImpl<PersonMapper, Person> impleme ...@@ -13,10 +13,11 @@ public class PersonServiceImpl extends ServiceImpl<PersonMapper, Person> impleme
@Autowired @Autowired
private PersonMapper personMapper; private PersonMapper personMapper;
// @DS(value ="ali-ds" ) // @DS(value ="ali-ds" )
@Override @Override
public Person savePerson(Person person) { public Person savePerson(Person person) {
personMapper.insert(person); personMapper.insert(person);
final int i = 1 / 0;
return person; return person;
} }
} }
...@@ -6,6 +6,7 @@ import com.kwan.springbootkwan.entity.User; ...@@ -6,6 +6,7 @@ import com.kwan.springbootkwan.entity.User;
import com.kwan.springbootkwan.mapper.UserMapper; import com.kwan.springbootkwan.mapper.UserMapper;
import com.kwan.springbootkwan.service.IPersonService; import com.kwan.springbootkwan.service.IPersonService;
import com.kwan.springbootkwan.service.IUserService; import com.kwan.springbootkwan.service.IUserService;
import io.seata.spring.annotation.GlobalTransactional;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -39,6 +40,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU ...@@ -39,6 +40,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
return userByName; return userByName;
} }
@GlobalTransactional
@Override @Override
public User saveUser(User user) { public User saveUser(User user) {
userMapper.insert(user); userMapper.insert(user);
......
...@@ -57,12 +57,13 @@ spring: ...@@ -57,12 +57,13 @@ spring:
seata: seata:
application-id: spring-boot-name application-id: spring-boot-name
tx-service-group: spring-boot-name-group tx-service-group: my-tx-group
service: service:
vgroup-mapping: vgroup-mapping:
spring-boot-demo-group: default my-tx-group: seata-server
grouplist: grouplist:
default: 127.0.0.1:8091 seata-server: 127.0.0.1:8091
enabled: true
......
service {
#事务组名称
vgroup_mapping.my-tx-group ="seata-server"
default.grouplist ="127.0.0.1:8091'
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册