我正在使用Callable接口在serviceImpl中编写多线程程序.我正在使用spring事务管理器.当在DB中执行更新操作时,它会成功执行.但更新的数据不会反映在DB中.但是当我在没有多线程的情况下运行程序时,它会在DB中更新.
这是我的配置
<tx:advice id="txAdvice" transaction-manager="txManager">
<tx:attributes>
<tx:method name="*" />
<tx:method name="find*" propagation="NOT_SUPPORTED" />
<tx:method name="get*" propagation="NOT_SUPPORTED" />
</tx:attributes>
</tx:advice>
<aop:config>
<aop:pointcut id="serviceOperation" expression="execution(* *..*ServiceImpl.*(..))" />
<aop:advisor advice-ref="txAdvice" pointcut-ref="serviceOperation" />
</aop:config>
<bean id="txManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource" />
</bean>
Run Code Online (Sandbox Code Playgroud)
我可以转向另一种方法来处理事务管理器.我想知道这种方法是否支持多线程.所以我的问题是 Spring spring事务管理器是否支持多线程(我的意思是仅通过声明注释或XML)为什么在我的情况下更新数据不会反映在DB中? 什么是最好的替代方法?