欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

|JTA|atomikos 连接超时设置

程序员文章站 2022-05-23 11:27:22
...
    @Bean
    @Primary
    public JtaTransactionManager jtaTransactionManager() throws SystemException {
        UserTransactionImp userTransactionImp = new UserTransactionImp();
        userTransactionImp.setTransactionTimeout(60);
        JtaTransactionManager jta = new JtaTransactionManager();
        jta.setUserTransaction(userTransactionImp);
        jta.setDefaultTimeout(60);
        return jta;
    }