diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/explore/support/MapJobExplorerFactoryBean.java b/spring-batch-core/src/main/java/org/springframework/batch/core/explore/support/MapJobExplorerFactoryBean.java index d52b140f1..9439ccd33 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/explore/support/MapJobExplorerFactoryBean.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/explore/support/MapJobExplorerFactoryBean.java @@ -44,7 +44,7 @@ public class MapJobExplorerFactoryBean extends AbstractJobExplorerFactoryBean { protected JobInstanceDao createJobInstanceDao() throws Exception { return new MapJobInstanceDao(); } - + @Override protected StepExecutionDao createStepExecutionDao() throws Exception { return new MapStepExecutionDao(); @@ -54,9 +54,10 @@ public class MapJobExplorerFactoryBean extends AbstractJobExplorerFactoryBean { protected ExecutionContextDao createExecutionContextDao() throws Exception { return new MapExecutionContextDao(); } - + public Object getObject() throws Exception { - return new SimpleJobExplorer(createJobInstanceDao(), createJobExecutionDao(), createStepExecutionDao(), createExecutionContextDao()); + return new SimpleJobExplorer(createJobInstanceDao(), createJobExecutionDao(), createStepExecutionDao(), + createExecutionContextDao()); } } diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/support/MapJobRepositoryFactoryBean.java b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/support/MapJobRepositoryFactoryBean.java index bb66aee31..f422eff66 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/support/MapJobRepositoryFactoryBean.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/support/MapJobRepositoryFactoryBean.java @@ -33,7 +33,9 @@ import org.springframework.beans.factory.FactoryBean; * implementations. This repository is only really intended for use in testing * and rapid prototyping. In such settings you might find that * {@link ResourcelessTransactionManager} is useful (as long as your business - * logic does not use a relational database). + * logic does not use a relational database). Not suited for use in + * multi-threaded jobs with splits, although it should be safe to use in a + * multi-threaded step. * * @author Robert Kasanicky */ diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/support/transaction/TransactionAwareProxyFactory.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/support/transaction/TransactionAwareProxyFactory.java index ecf1043b4..abf6b8b3a 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/support/transaction/TransactionAwareProxyFactory.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/support/transaction/TransactionAwareProxyFactory.java @@ -41,7 +41,9 @@ import org.springframework.transaction.support.TransactionSynchronizationManager * Works well with collections and maps for testing transactional behaviour * without needing a database. The base implementation handles lists, sets and * maps. Subclasses can implement {@link #begin(Object)} and - * {@link #commit(Object, Object)} to provide support for other resources. + * {@link #commit(Object, Object)} to provide support for other resources.
+ * + * Not intended for multi-threaded use. * * @author Dave Syer * diff --git a/src/site/docbook/reference/job.xml b/src/site/docbook/reference/job.xml index 43a55e1ef..36cfbe127 100644 --- a/src/site/docbook/reference/job.xml +++ b/src/site/docbook/reference/job.xml @@ -2,42 +2,61 @@ - Configuring and Running a Job + Configuring and Running a Job - In , the overall architecture design was - discussed, using the following diagram as a guide: + + In + + , the overall architecture design was + discussed, using the following diagram as a guide: + - - - - + + + + - - - - + + + + - While the Job object may seem like a simple - container for steps, there are many configuration options of which a - developers must be aware . Furthermore, there are many considerations for - how a Job will be run and how its meta-data will be - stored during that run. This chapter will explain the various configuration - options and runtime concerns of a Job. + + While the + Job + object may seem like a simple + container for steps, there are many configuration options of which a + developers must be aware . Furthermore, there are many considerations for + how a + Job + will be run and how its meta-data will be + stored during that run. This chapter will explain the various configuration + options and runtime concerns of a + Job + . + -
- Configuring a Job +
+ Configuring a Job - There are multiple implementations of the Job interface, however, the - namespace abstracts away the differences in configuration. It has only - three required dependencies: a name, JobRepository, - and a list of Steps. + + There are multiple implementations of the + + Job + + interface, however, the + namespace abstracts away the differences in configuration. It has only + three required dependencies: a name, + JobRepository + , + and a list of + Step + s. + - <job id="footballJob"> + <job id="footballJob"> <step id="playerload" parent="s1" next="gameLoad"/> <step id="gameLoad" parent="s2" next="playerSummarization"/> <step id="playerSummarization" parent="s3"/> @@ -334,9 +353,9 @@ catch (JobRestartException e) { Note that the in-memory repository is volatile and so does not allow restart between JVM instances. It also cannot guarantee that two - job instances with the same parameters are launched simultaneously. So - use the database version of the repository wherever you need quality of - service. + job instances with the same parameters are launched simultaneously, and + is not suitable for use in a multi-threaded Job, or a locally partitioned Step. So + use the database version of the repository wherever you need those features. However it does require a transaction manager to be defined because there are rollback semantics within the repository, and because