【发布时间】:2016-02-03 16:45:42
【问题描述】:
这是我们的应用程序如何为 Spring 批处理配置的。
Spring 批处理和 Quartz 相关表在单独的实例上配置。 特定于应用程序的数据库实例是不同的。 应用程序在 WebSphere Application Server 8.0 上运行
我们不希望将 spring 批处理事务传播到 tasklet 执行。为了实现这一点,我们已经尝试过,但它似乎不起作用。 有没有人遇到过类似的问题?请建议如何进行。
交易没有暂停。 Spring 使用 ConnectionHolder 缓存连接,如果它在事务下,则不会释放连接。我们不希望连接被缓存,我们希望从数据源(连接池)获取新的连接,而不是使用 spring 缓存的连接句柄。
<batch:job id="jobId" job-repository="jobRepository">
<batch:step id="stepId">
<batch:tasklet ref="taskletId">
<batch:transaction-attributes propagation="NOT_SUPPORTED" />
</batch:tasklet>
</batch:step>
</batch:job>
<bean id="transactionManager" class="org.springframework.transaction.jta.WebSphereUowTransactionManager"/>
谢谢。
【问题讨论】:
标签: spring websphere spring-batch spring-transactions propagation