The current default for serializing the ExecutionContext is via XStream
using Jettison's driver. However, recent updates to Jettison make it
incompatible with XStream with no progress on a fix. Because of this,
and to encourage the use of well supported library combinations, the
default ExecutionContext serialization mechanism for Spring Batch has
been switched to Jackson (via the
Jackson2ExecutionContextStringSerializer). This commit also depricates
the XStreamExecutionContextStringSerializer for removal at a later date.
However, it is still available for users that require that during a
migration.
Resolves BATCH-2575
Spring Batch's implementation of JSR-352 previously relied on Spring's
ContextSingletonBeanFactoryLocator. However, this has been removed in
Spring 5 as a relic of older EJB based use cases. This commit now
lazily bootstraps the base context on it's own when the first
JsrJobOperator is requested.
Resolves BATCH-2572
The exception message for the Serializable check in
DefaultExecutionContextSerializer is always generated. For large
contexts this can quickly put a log of pressure on the allocator and
the heap.
This commit contains the following changes:
* generate the exception message for non-serializable values in
DefaultExecutionContextSerializer only when needed
I have signed and agree to the terms of the SpringSource Individual
Contributor License Agreement.
Issue: BATCH-2396
This commit moves all SNAPSHOT dependencies to the latest available
released versions. It also addresses a number of deprications in the
Spring Data realm. Specifically around the deprication of the
Neo4JOperations and the package reorganization within Hibernate.
When determining if an exception should be skipped or not, the business
exception should be used. However, when an exception is thrown in the
listener, it's wrapped by a `StepListenerFailedException`. This leads
to it hiding the underlying exception. This commit will unwrap the
cause of a `StepListenerFailedException` and use that to determine if it
should be skipped or not.
Resolves BATCH-2322
Prior to this commit, when using the `JobStep`, if the child job was
stopped (left in the `STOPPED` state), the step executing that job was
marked as `COMPLETE`, preventing it from being restarted. This commit
now marks a step that was executing the stopped job also as stopped,
allowing for it to be restarted.
Resolves BATCH-2429
Previously, AutomaticJobRegistrar listened to all ApplicationEvents
despite only being interested in two ApplicationContextEvents, namely
ContextRefreshedEvent and ContextClosedEvent. This could lead to
an AutomaticJobRegistrar instance being created earlier than necessary.
This commits tightens up AutomaticJobRegistrar so that it only listens
to ApplicationContextEvents.
Closes BATCH-2506
See https://github.com/spring-projects/spring-boot/issues/2395
It has been tested with Jackson 2.3.3 which is the Jackson version
used with the Spring dependency.
Tests have been updated to use Hamcrest matchers and made a bit more reusable.
With Java 1.5 StringBuilder is preferred over StringBuffer for single
threaded access as is has less overhead.
This is evidenced by the class comment of StringBuffer and Effective
Java 2nd Edition Item 67: Avoid excessive synchronization.
> The StringBuilder class should generally be used in preference to
> this one, as it supports all of the same operations but it is faster,
> as it performs no synchronization.
- replace StringBuffer with StringBuilder where possible
Issue: BATCH-2407
In various places in the code base a debug message is constructed
unconditionally. This adds unnecessary overhead in the common case when
debug logging is off.
- add guards around debug statements in non-test code
Issue: BATCH-2412
This is a follow-on from adc2f79. It removes the remaining references
to ParameterizedRowMapper and should, therefore, make things fully
compatible with Spring Framework 4.2.
UNKNOWN
* additionally prevent restart of step executions with status STARTING,
STARTED or STOPPING
* additionally prevent restart of job executions with status UNKNOWN or
STOPPING
InnoDB is the only option for transactional tables in MySql. This
change makes all the table definitions consistent (there previously were
a few that were MyISAM).
BATCH-2373
To support Spring Framework 4.2 which removes ParameterizedRowMapper,
all references to that were switched to RowMapper. As of Spring 3, the
interfaces are identicle so this should cause no backward compatability
issues.
BATCH-2369
This commit includes the parent builder's current state from a
SplitBuilder in the actual split. The documentation is also updated to
note that a user should either create a flow with transitions or a flow
that splits, not both and use composition to create more complex flows.
BATCH-2346
Prior to this commit, the SystemCommandTasklet is able to be stopped
only by an external process calling directly into it or updating the
instance of the StepExecution it holds onto. This update allows the
tasklet to poll the job repository for stop requests in a similar way
chunk based processing does.
BATCH-2331
While existing functionality provided the ability to override the
components provided in the baseContext.xml (as required for JSR-352
functionality) at a job by job level, this commit allows a user to
specify a base context for all of the JSR-352 based jobs within a JVM.
To set the location of the custom base context, a JVM property
JSR-352-BASE-CONTEXT should be set.
BATCH-2290
While the JSR-352 provides only one way to access the JobOperator
(BatchRuntime.getJobOperator()), it is useful for testing and embedding
to be able to wire your own JsrJobOperator instance. This commit
addresses previous issues with using the constructor that provided that
functionality.
Note: This is a breaking change in that there is a new parameter on the
non-default constructor (adding a PlatformTransactionManager reference).
Users using the JsrJobOperator through the BatchRuntime as previously
mentioned should not be impacted. Since this is the *only* method
perscribed by the JSR to consume that class, it is not expected to have
a large impact.
This fix partially addresses BATCH-2290.
contexts scenarios
AbstractApplicationContextFactory, when configuring a child context,
copies all of the BeanPostProcessors from the parent to the child.
Normally this is a good thing. However, in the case of teh
ApplicationContextAwareProcessor, the child context ends up with two
instances, one for the parent context and one for the child context.
This brings two issues to light:
1. Unknown which context is being injected - On beans implementing
ApplicationContextAware, it can't be determined which context (the
parent or the child) will be injected since both BPPs will be called in
an indeterimant order.
2. Errors occur with ApplicationObjectSupport - If the child context
contains a bean that extends ApplicationObjectSupport, when the second
ApplicationContextAwareProcessor is called, the bean will throw an
exception since it is only allowed to be initialized with one
application context.
This fix adds additional logic to remove the
ApplicationContextAwareProcessor from the parent context before adding
all the BPPs to the child.
This fix addresses BATCH-2319.
BATCH-2159 provides a tweak to the insert statement used for
initializing the sequence tables used in the job repository database so
that they don't error if run multiple times as well as don't insert
multiple rows.
When using java config, the call to SimpleFlow#afterPropertiesSet is not
called in all cases as noted in BATCH-2291. This commit updates the
builder to explicitly make the call, and updates the SimpleFlow to be
idempotent for calls to afterPropertiesSet.