Mas*_*ues 5 transactions spring-integration spring-batch
我有一个spring集成+批处理应用程序.
集成用于使用inboun通道适配器读取文件并调用批处理作业.jobRepository定义于:org.springframework.batch.core.repository.support.JobRepositoryFactoryBean
事务管理器是org.springframework.orm.jpa.JpaTransactionManager.
当应用程序启动时,我不知道为什么,但我读了这种奇怪的配置:
[5860] [2012-03-12 17:40:47,267] D [main] [org.springframework.transaction.interceptor.NameMatchTransactionAttributeSource] Adding transactional method [*] with attribute [PROPAGATION_REQUIRED,ISOLATION_DEFAULT]
[5860] [2012-03-12 17:40:47,267] D [main] [org.springframework.transaction.interceptor.NameMatchTransactionAttributeSource] Adding transactional method [create*] with attribute [PROPAGATION_REQUIRES_NEW,ISOLATION_SERIALIZABLE]
[5860] [2012-03-12 17:40:47,267] D [main] [org.springframework.transaction.interceptor.NameMatchTransactionAttributeSource] Adding transactional method [getLastJobExecution*] with attribute [PROPAGATION_REQUIRES_NEW,ISOLATION_SERIALIZABLE]
Run Code Online (Sandbox Code Playgroud)
似乎默认情况下,每个jobmethod都配置了隔离SERIALIZABLE,但我没有设置它.知道如何将默认隔离级别设置为ISOLATION_DEFAULT吗?
默认情况下它是可串行化的,以防止同一作业实例在 2 个或更多机器上同时执行。如果您不担心这个问题,您可以放松一下。
这
isolation-level-for-create
Run Code Online (Sandbox Code Playgroud)
属性控制 create* 和 getLastJobExecution* 方法的传播
归档时间: |
|
查看次数: |
10410 次 |
最近记录: |