2010-07-15 7 views
7

मैं एक जे 2 एसई एप्लीकेशन चला रहा हूं जो एटमिकोस का उपयोग करता है जो वर्तमान निर्देशिका में कई लॉग फाइलों को डंप करता है। मैं इन फ़ाइलों के स्थान को "/ tmp" पर ले जाना चाहता हूं, लेकिन मैं एक कॉन्फ़िगरेशन प्रॉपर्टी का पता नहीं लगा सकता जिसे मैं अपनी स्प्रिंग एक्सएमएल कॉन्फ़िगरेशन फ़ाइल से सेट कर सकता हूं।एटमिकोस के tm.out और * .epoch फ़ाइलों के स्थान को कैसे स्थानांतरित करें?

com.atomikos.icatch.output_dir 

वास्तव में लगता है कौन सा मैं क्या जरूरत है, लेकिन यह कैसे स्प्रिंग से बिना एक jta.properties फ़ाइल स्थापित करने के लिए:

Atomikos प्रलेखन एक संपत्ति का संदर्भ? यहाँ मेरी लेनदेन प्रबंधक 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> 

उत्तर

11

सवाल में संपत्ति transactionService की सिंगलटन उदाहरण पर सेट किया जाना चाहिए - एक उद्देश्य यह है कि सामान्य रूप से उपयोगकर्ता लेन-देन प्रबंधक द्वारा मांग पर बनाई गई है:

<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> 

अब संपत्ति सेट है। लेकिन यह सुनिश्चित करने के लिए कि आपके पास दो लेनदेन सेवाएं नहीं चल रही हैं, आपको उपयोगकर्ता लेनदेन प्रबंधक बीन को निम्नानुसार संशोधित करना होगा:

<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> 
+0

+1 दोनों प्रश्न और उत्तर के लिए –

संबंधित मुद्दे