Atomikos 配置 UserTransactionImp 和 UserTransactionServiceImp

Atomikos config UserTransactionImp with UserTransactionServiceImp

我将 Atomikos 与 Spring 一起使用,我在更新 max_actives 时遇到问题。

我正在创建 UserTransactionImp

<bean id="AtomikosUserTransaction" class="com.atomikos.icatch.jta.UserTransactionImp">
    <property name="transactionTimeout" value="300"/>
</bean>

但我想用 max_actives

的配置设置 UserTransactionServiceImp
<bean id="atomikosUserTransactionService" class="com.atomikos.icatch.config.UserTransactionServiceImp"
      init-method="init" destroy-method="shutdownForce">
    <constructor-arg>
        <props>
            <prop key="com.atomikos.icatch.service">com.atomikos.icatch.standalone.UserTransactionServiceFactory</prop>
            <prop key="com.atomikos.icatch.log_base_name">f2e_transactions</prop>
            <prop key="com.atomikos.icatch.output_dir">../standalone/log/</prop>
            <prop key="com.atomikos.icatch.log_base_dir">../standalone/log/</prop>
            <prop key="com.atomikos.icatch.max_actives">1000</prop>

        </props>
    </constructor-arg>
</bean>

问题是 UserTransactionImp 似乎正在手动创建 UserTransactionService 的实例。

知道如何在 Spring 配置中实现这个吗?

 private void checkSetup() {
        Class var1 = TransactionManagerImp.class;
        synchronized(TransactionManagerImp.class) {
            this.txmgr_ = TransactionManagerImp.getTransactionManager();
            if (this.txmgr_ == null) {
                UserTransactionService uts = new UserTransactionServiceImp();
                uts.init();
                this.txmgr_ = TransactionManagerImp.getTransactionManager();
            }

        }
    }

此致。

您可以在类路径的根目录中提供一个名为 transactions.properties 的文件,而不是配置 UserTransactionServiceImp,如此处所述:

https://www.atomikos.com/Documentation/JtaProperties