Lucas Ward opened BATCH-7 and commented
Currently, all input templates (simpleFileInput is an exception) store their state in a threadlocal. However, this impacts readability and is overkill for most cases. It may be a better approach to either remove the thread local with the expectation that either the input or the entire module itself will be wrapped in a threadlocal scope(since many cases may result in a non-thread safe module being created and then needing partitioning for performance reasons) Or the InputState could be created as a dependency to the inputs (something like SqlInputState) which would default to a simple, non thread safe implementation, but could be replaced with an implementation that uses either a wrapper or composite pattern to wrap the state in a thread local.
Affects: 1.0-m1
Issue Links: - BATCH-26 Use of read ahead limit on ResourceLineReader is flawed or at least worrying ("is depended on by") - BATCH-189 Move TransactionSynchronization to base class ("is depended on by")
该提问来源于开源项目:spring-projects/spring-batch