How to move the location of Atomikos tm.out and * .epoch files?

I am running a J2SE application that uses Atomikos, which uploads numerous log files to it. I would like to move the location of these files to "/ tmp", but I cannot find the configuration property that I can set from my Spring XML configuration file.

Atomikos documentation refers to a property:

com.atomikos.icatch.output_dir 

It seems that exactly what I need, but how to install from Spring without the jta.properties file? Here is my transaction manager configuration:

 <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> 
+7
spring logging configuration temporary-files atomikos
source share
1 answer

The required property must be set on a singleton instance of the Service transaction - an object that is usually created upon request by the user's transaction manager:

 <bean id="userTransactionService" class="com.atomikos.icatch.config.UserTransactionServiceImp" init-method="init" destroy-method="shutdownForce"> <constructor-arg> <!-- IMPORTANT: specify all Atomikos properties here --> <props> <prop key="com.atomikos.icatch.service">com.atomikos.icatch.standalone.UserTransactionServiceFactory</prop> <prop key="com.atomikos.icatch.output_dir">target/</prop> <prop key="com.atomikos.icatch.log_base_dir">target/</prop> </props> </constructor-arg> </bean> 

Now the property is set. But to make sure you don’t have two transactional services, you should also modify the bean user’s transaction manager as follows:

 <bean id="atomikosTransactionManager" class="com.atomikos.icatch.jta.UserTransactionManager" init-method="init" destroy-method="close" depends-on="userTransactionService"> <!-- When close is called, should we force transactions to terminate? --> <property name="forceShutdown" value="false" /> <!-- Do not create a transaction service as we have specified the bean in this file --> <property name="startupTransactionService" value="false" /> </bean> 
+11
source share

All Articles