Giter VIP home page Giter VIP logo

Comments (3)

changmingxie avatar changmingxie commented on June 7, 2024

当然。本身就是为分布式环境下设计实现的。

from tcc-transaction.

wuherong avatar wuherong commented on June 7, 2024

你好,我现在建了两个应用,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.

changmingxie avatar changmingxie commented on June 7, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.