5

私は春の統合+バッチアプリケーションを持っています。

統合は、受信チャネル アダプターでファイルを読み取り、バッチ ジョブを呼び出すために使用されます。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]

デフォルトでは、すべてのジョブメソッドが分離SERIALIZABLEで構成されているようですが、どこにも設定していません。デフォルトの分離レベルを ISOLATION_DEFAULT として設定する方法はありますか?

4

1 に答える 1

4

同じジョブ インスタンスが 2 つ以上のボックスで同時に実行されるのを防ぐために、デフォルトで SERIALIZABLE になっています。これが気にならない場合は、リラックスできます。

http://static.springsource.org/spring-batch/reference/html/configureJob.html#txConfigForJobRepository

isolation-level-for-create

属性は、create* および getLastJobExecution* メソッドの伝播を制御します

于 2012-03-12T18:38:19.793 に答える