提交 b896883f 编写于 作者: U ujued

tx:clean demo

上级 8cd5d330
......@@ -11,7 +11,6 @@ import com.example.service.DemoApiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
......@@ -47,7 +46,6 @@ public class DemoApiServiceImpl implements DemoApiService {
@Override
@TxTransaction
@Transactional
public String execute(String name) {
String dResp = dDemoService.rpc(name);
String eResp = eDemoService.rpc(name);
......
......@@ -9,7 +9,6 @@ import com.example.demoe.mapper.DDemoMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
......@@ -37,7 +36,6 @@ public class DefaultDemoService implements DDemoService {
private String appName;
@Override
@Transactional
@TxTransaction(type = "txc")
public String rpc(String name) {
Demo demo = new Demo();
......
......@@ -5,12 +5,10 @@ import com.codingapi.example.common.db.domain.Demo;
import com.codingapi.example.common.dubbo.EDemoService;
import com.codingapi.tx.client.bean.DTXLocal;
import com.codingapi.tx.commons.annotation.TccTransaction;
import com.codingapi.tx.commons.annotation.TxTransaction;
import com.example.demoe.mapper.EDemoMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.concurrent.ConcurrentHashMap;
......@@ -40,8 +38,6 @@ public class DefaultDemoService implements EDemoService {
private String appName;
@Override
@Transactional
@TxTransaction(type = "tcc")
@TccTransaction(confirmMethod = "cm", cancelMethod = "cl", executeClass = DefaultDemoService.class)
public String rpc(String name) {
Demo demo = new Demo();
......
......@@ -6,6 +6,7 @@ import com.codingapi.example.common.spring.EDemoClient;
import com.codingapi.example.client.mapper.ClientDemoMapper;
import com.codingapi.tx.client.bean.DTXLocal;
import com.codingapi.tx.commons.annotation.LcnTransaction;
import com.codingapi.tx.commons.util.DTXFunctions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
......
......@@ -5,6 +5,7 @@ import com.codingapi.example.demod.mapper.DDemoMapper;
import com.codingapi.example.demod.service.DemoService;
import com.codingapi.tx.client.bean.DTXLocal;
import com.codingapi.tx.commons.annotation.TxcTransaction;
import com.codingapi.tx.commons.util.DTXFunctions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
......@@ -29,8 +30,7 @@ public class DemoServiceImpl implements DemoService {
@Override
@TxcTransaction
@Transactional
@TxcTransaction(func = DTXFunctions.JOIN)
public String rpc(String value) {
Demo demo = new Demo();
demo.setCreateTime(new Date());
......
......@@ -5,6 +5,7 @@ import com.codingapi.example.demo.mapper.EDemoMapper;
import com.codingapi.example.demo.service.DemoService;
import com.codingapi.tx.client.bean.DTXLocal;
import com.codingapi.tx.commons.annotation.TccTransaction;
import com.codingapi.tx.commons.util.DTXFunctions;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
......@@ -33,7 +34,7 @@ public class DemoServiceImpl implements DemoService {
private String appName;
@Override
@TccTransaction
@TccTransaction(func = DTXFunctions.JOIN)
public String rpc(String value) {
Demo demo = new Demo();
demo.setDemoField(value);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册