Atomikos Forum

JTA transaction propagation

Hi,

Can some one post a sample of how to propagate a transaction between 2 processes when you are using the JTA Atomikos layer and not the low level API?

How do you import and export the transaction?

Thanks.
Yair Ogen Send private email
Thursday, February 26, 2009
 
 
Hi,

Please check the API guide in the docs folder.

HTH
Guy Pardon Send private email
Thursday, February 26, 2009
 
 
Hi,

I tried out the doc.

I found that I need to use the following API:

ExportingTransactionManager exportingTransactionManager = userTransactionService.getExportingTransactionManager();

com.atomikos.icatch.Propagation propagation = exportingTransactionManager.getPropagation();

Extent extent = doSomething(propagation);            
            exportingTransactionManager.addExtent(extent);

The thing is I take the userTransactionService object from Spring definition. But the "ExportingTransactionManager" instance it returns is null.

Does someone know what may be the problem?

The spring definition is:

    <bean id="userTransactionService" class="com.atomikos.icatch.config.UserTransactionServiceImp">
        <constructor-arg>
            <props>
                <prop key="com.atomikos.icatch.service">com.atomikos.icatch.standalone.UserTransactionServiceFactory</prop>
                <prop key="com.atomikos.icatch.output_dir">${user.home}/transactions</prop>
                <prop key="com.atomikos.icatch.log_base_dir">${user.home}/transactions</prop>
                <prop key="com.atomikos.icatch.console_file_name">my_tm.out</prop>
                <prop key="com.atomikos.icatch.log_base_name">my_tm.log</prop>
                <prop key="com.atomikos.icatch.tm_unique_name">my_tm</prop>
                <prop key="com.atomikos.icatch.console_log_level">INFO</prop>
            </props>
        </constructor-arg>
    </bean>


    <bean id="jtaTransactionManager"
        class="org.springframework.transaction.jta.JtaTransactionManager"
        lazy-init="true" depends-on="userTransactionService">

        <property name="transactionManager">
            <ref bean="atomikosTransactionManager" />
        </property>
        <property name="userTransaction">
            <ref bean="atomikosUserTransaction" />
        </property>
    </bean>
Yair Ogen Send private email
Sunday, March 01, 2009
 
 
Try:

com.atomikos.icatch.service=com.atomikos.icatch.trmi.UserTransactionServiceFactory

HTH
Guy Pardon Send private email
Tuesday, March 03, 2009
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics