我在使用Spring的Atomikos时遇到了更新max_actives的问题。
我正在创建UserTransactionImp
<bean id="AtomikosUserTransaction" class="com.atomikos.icatch.jta.UserTransactionImp">
<property name="transactionTimeout" value="300"/>
</bean>
但我想将UserTransactionServiceImp
设置为max_actives
<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();
}
}
}
问候。
答案 0 :(得分:1)
您可以在类路径的根目录中提供名为transactions.properties的文件,而不是配置UserTransactionServiceImp,如下所述: