Note that there are some explanatory texts on larger screens.

plurals
  1. POSpring batch and XA and local transactions
    primarykey
    data
    text
    <p>It is possible to have a jobRepository in spring batch to use local transactions but execute particular job steps in distributed XA transaction?</p> <p>For XA I use Atomicos 3.8.0. Step is supposed to read the JMS message and update the DB after processing.</p> <p>The relevant part of spring configuration:</p> <pre><code>&lt;job id="job" xmlns="http://www.springframework.org/schema/batch"&gt; &lt;step id="inventorySync"&gt; &lt;tasklet transaction-manager="xaTransactionManager"&gt; &lt;chunk reader="jmsQueueReader" processor="messageProcessor" writer="dbWriter" reader-transactional-queue="true"/&gt; &lt;/tasklet&gt; &lt;/step&gt; &lt;/job&gt; &lt;bean id="xaTransactionManager" class="org.springframework.transaction.jta.JtaTransactionManager" lazy-init="true" depends-on="inventoryDataSource"&gt; &lt;constructor-arg name="transactionManager" ref="userTransactionManager"/&gt; &lt;constructor-arg name="userTransaction" ref="userTransaction"/&gt; &lt;property name="allowCustomIsolationLevels" value="true"/&gt; &lt;/bean&gt; &lt;bean id="jobRepository" class="org.springframework.batch.core.repository.support.JobRepositoryFactoryBean"&gt; &lt;property name="dataSource" ref="batchJobsDataSource"/&gt; &lt;property name="transactionManager" ref="transactionManager"/&gt; &lt;property name="databaseType" value="${batch.data.source.type}"/&gt; &lt;/bean&gt; &lt;jdbc:embedded-database id="batchJobsDataSource" type="HSQL"/&gt; &lt;bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"&gt; &lt;property name="dataSource" ref="batchJobsDataSource"/&gt; &lt;/bean&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload