Comments (3)
当然。本身就是为分布式环境下设计实现的。
from tcc-transaction.
你好,我现在建了两个应用,A应用调B应用的两个方法,想做事务控制,可是都是在单独的事务里面。
我改了下这个地方,加了备注,否则不能够注入BeanFactory工厂,不知是否与这个有关,但是去除备注的话,两个应用,对应的BeanFactory很定不是一个,获取Bean的实例,及自动注入就有问题了。如果是一个工程这样倒是可以。不知我的理解是否正确。
public class TccBeanPostProcessor implements ApplicationListener {
@Override
public void onApplicationEvent(ContextRefreshedEvent contextRefreshedEvent) {
ApplicationContext applicationContext = contextRefreshedEvent.getApplicationContext();
//if (applicationContext.getParent() == null) {
BeanFactoryAdapter.setBeanFactory(applicationContext.getBean(BeanFactory.class));
//}
}
}
from tcc-transaction.
@wuherong,
你好,你建的A,B两个应用是部署在不同的节点上的吧(使用不同的JVM)?,如果是部署在不同的节点,那么BeanFactory一定是不同的;
在tcc-transaction-dubbo-sample里示例了3个应用使用tcc-transaction例子,
分别是tcc-transaction-dubbo-order、tcc-transaction-capital、tcc-transaction-redpacket,这三个应用可分别部署在不同节点,希望能对你有帮助。
特别说明下,tcc-transaction.xml一定要加载到classpath中;如在web.xml中:
contextConfigLocation
classpath:tcc-transaction.xml
from tcc-transaction.
Related Issues (20)
- 实现动态全局事务管理开关 HOT 1
- 测试出现的2个问题 HOT 1
- tcc-transaction 1.2.12 Dubbo模块,TccInvokerInvocationHandler 设置参数bug HOT 1
- tcc-transaction 1.2.12 api模块,TransactionXid 定制事务编号 HOT 1
- tcc-transaction没看到有与springboot和springcloud生态整合的说明,是不支持吗? HOT 2
- tcc版本1.2.12,duobbo版本2.7.0,主事务到分支事务xid传参错误问题 HOT 6
- 红包金额表和红包订单表都在一个数据库里面,为什么要用分布式事务呢?直接用 spring 支持的@transactional 不行吗? HOT 2
- tcc-http-sample 样例演示购买超链接 抛异常 java.net.SocketTimeoutException: Read timed out HOT 1
- why TradeOrderServiceProxy.record need @Compensable ? HOT 1
- sample中dubbo方式数据库问题 HOT 1
- tcc-transaction分布式事务管理器操作文档 HOT 1
- 如何避免tcc try阶段业务并发重复调用 HOT 2
- 是否支持防悬挂控制 HOT 4
- tcc-transaction 与Dubbo整合后,三层事务方法,底层服务无法confirm或cancel的问题 HOT 3
- 无,看错
- 作者牛逼 HOT 1
- 谁在使用tcc-transaction HOT 1
- 请问如何防止脏读和脏写? HOT 1
- 客户端无法注册naocs HOT 1
- Dependency org.yaml:snakeyaml, leading to CVE problem HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tcc-transaction.