如何移动 Atomikos 的 tm.out 和 *.epoch 文件的位置?
我正在运行一个使用 Atomikos 的 J2SE 应用程序,它将大量日志文件转储到当前目录。我想将这些文件的位置移动到“/tmp”,但我找不到可以在 Spring XML 配置文件中设置的配置属性。
Atomikos 文档引用了一个属性:
com.atomikos.icatch.output_dir
这似乎正是我所需要的,但是如何在没有 jta.properties 文件的情况下从 Spring 设置它?这是我的事务管理器配置:
<bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager">
<property name="transactionManager" ref="atomikosTransactionManager" />
<property name="userTransaction" ref="atomikosUserTransaction" />
</bean>
<bean id="atomikosTransactionManager" class="com.atomikos.icatch.jta.UserTransactionManager"
init-method="init" destroy-method="close">
<!-- When close is called, should we force transactions to terminate? -->
<property name="forceShutdown" value="false" />
</bean>
<bean id="atomikosUserTransaction" class="com.atomikos.icatch.jta.UserTransactionImp">
<!-- Number of seconds before transaction timesout. -->
<property name="transactionTimeout" value="30" />
</bean>
I'm running a J2SE application that uses Atomikos which dumps it's numerous log files to the current directory. I'd like to move the location of these files to "/tmp", but I cannot locate a configuration property that I can set from within my Spring XML config file.
The Atomikos documentation references a property:
com.atomikos.icatch.output_dir
Which seems exactly what I need, but how to set from Spring it without a jta.properties file? Here is my transaction manager config:
<bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager">
<property name="transactionManager" ref="atomikosTransactionManager" />
<property name="userTransaction" ref="atomikosUserTransaction" />
</bean>
<bean id="atomikosTransactionManager" class="com.atomikos.icatch.jta.UserTransactionManager"
init-method="init" destroy-method="close">
<!-- When close is called, should we force transactions to terminate? -->
<property name="forceShutdown" value="false" />
</bean>
<bean id="atomikosUserTransaction" class="com.atomikos.icatch.jta.UserTransactionImp">
<!-- Number of seconds before transaction timesout. -->
<property name="transactionTimeout" value="30" />
</bean>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
必须在 transactionService 的单例实例上设置有问题的属性——通常由用户事务管理器按需创建的对象:
现在属性已设置。但为了确保没有两个事务服务正在运行,您还必须修改用户事务管理器 bean,如下所示:
The property in question must be set on the singleton instance of the transactionService -- an object that is normally created on-demand by the user transaction manager:
Now the property is set. But in order to ensure you don't have two transaction services running you must also modify the user transaction manager bean as follows: