Commit Graph

1900 Commits

Author SHA1 Message Date
Cameron
9256148cf2 BATCH-2630 - update not to rely on step execution order from DAO 2017-07-17 11:22:40 -05:00
Michael Minella
263e978a1f Updated for various code warnings
This commit addresses a number of deprications and other code warnings.
There are still many more to address, but this is a start.
2017-05-02 12:48:03 -05:00
Michael Minella
4ad00166f8 Changed default ExecutionContext serialization mechanism
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
2017-03-22 15:25:14 -05:00
Michael Minella
a6c4dacbbe Refactored bootstrapping of JSR-352 base context
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
2017-03-09 12:16:41 -06:00
Philippe Marschall
f78aa275c0 BATCH-2396 Guard Serializable check message
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
2017-02-02 12:25:11 -06:00
Michael Minella
54a90beed7 Upgraded Mockito
This commit upgrades mockito to the latest currently available version
as well as does some additional cleanup.
2017-01-24 14:18:05 -06:00
Michael Minella
26b02fb836 Replaced snapshot versions and addressed deprications
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.
2016-12-30 14:04:58 -06:00
Michael Minella
80a153527f Updated test based on new error message returned by Spring Framework 5 2016-11-18 10:33:41 -06:00
Michael Minella
a75b067ebc Added builder for JdbcCursorItemReader
This provides a builder for the JdbcCursorItemReader to simplify java
configuration.

Resolves BATCH-2555
2016-11-18 09:18:26 -06:00
Michael Minella
eb2f752b16 Unwrap StepListenerFailedException when determining skip/rollback
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
2016-10-17 11:27:15 -05:00
Michael Minella
ca847e2760 Addressed stopped jobs from a job step
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
2016-10-14 12:07:48 -05:00
Michael Minella
23f599f1f5 Updated test to dynamically obtain java executable location 2016-10-03 12:56:33 -05:00
Michael Minella
f4c0530730 Upgraded dependency versions and minor polish 2016-08-09 13:19:14 -05:00
Michael Minella
e375771ba6 Fixed doc tags 2016-08-08 15:33:39 -05:00
Billy Korando
e754c8617a Update EnableBatchProcessing.java
Updating the Javadoc for EnablebatchProcessing to include additional beans it puts in context.
2016-08-08 15:16:23 -05:00
Nick Vanderhoven
f7e10909f9 BATCH-2513 Fix for typo in log statement of AbstractListenerFactoryBean.isListener 2016-08-08 13:21:36 -05:00
Andy Wilkinson
5867606f4b Tighten up AutomaticJobRegistrar’s event listening
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
2016-07-20 22:25:58 -05:00
Michael Minella
ade242f2c4 Updated SimpleStepExecutionSplitter to return a Set with addressable elements 2016-04-19 16:31:23 -05:00
Michael Minella
6e0d0531ce Fixes default schema version 2016-04-19 16:14:22 -05:00
Marten Deinum
22109eea84 This commit adds a ExecutionContextSerializer based on Jackson2.
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.
2016-04-19 12:54:59 -05:00
mark kouba
f6d22f4f80 add shutdown for thread pool task executor so it cleans up and shutdowns
correctly before method exits.
2015-11-25 16:18:56 -06:00
Michael Minella
eafa7ee152 BATCH-2313: Fixed regression of BATCH-2153 by updating HashMap to ConcurrentHashMap 2015-10-15 16:04:00 -05:00
Philippe Marschall
dcc9da8273 BATCH-2407 Use StringBuilder instead of StringBuffer
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
2015-08-06 10:22:39 -05:00
Philippe Marschall
3783345c55 BATCH-2412 Add guards around debug statements
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
2015-08-05 12:04:44 -05:00
Philippe Marschall
7ec7152c5e BATCH-2410 junit.framework.Assert is deprecated 2015-07-31 12:44:25 -05:00
Alex Jablonski
cbc83015d5 Add regression unit test covering behavior reported in BATCH_2346
Observed that deleting the code fixing issue BATCH_2346 didn't cause
any tests to fail
2015-07-14 14:21:41 -05:00
Andy Wilkinson
ff2b6a8cee Remove remaining dependencies on ParameterizedRowMapper
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.
2015-07-09 16:04:50 -05:00
jpraet
61638d52bd BATCH-2311 JobLauncher allows restart of job_execution with status
UNKNOWN

* additionally prevent restart of step executions with status STARTING,
STARTED or STOPPING
* additionally prevent restart of job executions with status UNKNOWN or
STOPPING
2015-06-09 10:06:15 -05:00
Christian Ramseier
77be8b97b4 use current classloader to get the proxied repository 2015-06-08 16:29:51 -05:00
Michael Minella
55ca2bc895 Changed MySql engines to all be InnoDB
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
2015-05-15 16:13:00 -05:00
Michael Minella
c8f8be3b8e Added additional tests around *Aware callbacks in GenericApplicatioNContextFactory BATCH-2358 2015-05-15 11:39:47 -05:00
sparsick
fa01295ce6 BATCH-2359: fix for the problem that job arguments defined after an empty line are ignored 2015-04-15 09:49:59 -04:00
Jason Pell
2cdadea4b3 BATCH-2353 update sql server ddl to support ANSI NULL Default = false 2015-04-08 16:43:17 -05:00
Michael Minella
7c60b055c3 Removed dependency on ParameterizedRowMapper
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
2015-03-31 14:08:38 -05:00
Michael Minella
8b32462072 Clear context to job name mapping when clearing contexts BATCH-2347 2015-03-06 11:54:44 -06:00
Michael Minella
256da94a74 Added javadoc discussing transactionality of the ItemWriteListener BATCH-2336 2015-03-06 10:15:29 -06:00
Michael Minella
4839102ed5 Refactored AbstractJsrTestCase to expose JobOperator instance 2015-02-19 13:06:51 -06:00
Michael Minella
15e7c3bc1e BATCH-2093: Exposed DefaultBatchConfigurer#createJobLauncher for extension 2015-02-06 10:41:51 -06:00
Gerald Quintana
ffc896ebbc BATCH-2282: SplitBuilder shouldn't add empty state in flow 2015-02-05 16:56:29 -06:00
Michael Minella
1720807c11 Fixed SplitBuilder to behave as documentation perscribes.
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
2015-02-05 12:11:33 -06:00
Michael Minella
bd644108f7 JsrJobOperator now implements ApplicationContextAware 2015-01-02 14:22:57 -06:00
thebignet
c662914896 Added unit test to verify JobScope works when using both @EnableBatchProcessing and XML namespace 2015-01-02 12:39:31 -06:00
Michael Minella
fecbe075d4 Added ability for SystemCommandTasklet to be stopped
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
2014-12-31 12:10:47 -06:00
Michael Minella
92e551e05d Add ability to override JSR-352 baseContext.xml
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
2014-12-30 16:16:02 -06:00
Michael Minella
c10469367f Fixed manual wiring of JsrJobOperator
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.
2014-12-22 16:57:16 -06:00
Michael Minella
7683700662 Filter out duplicate ApplicationContextAwareProcessors in parent/child
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.
2014-11-05 16:34:51 -06:00
Chris Schaefer
8b26504db1 BATCH-2242: Stopping a job in STARTING state throws OptimisticLockingFailureException 2014-10-17 11:40:38 -05:00
Michael Minella
b8238908df Updated sequence initalization insert to be idempotent
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.
2014-10-17 11:12:12 -05:00
Michael Minella
f865eb0135 Add explicit call to afterPropertiesSet to a Flow when using Java config
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.
2014-10-15 14:36:13 -05:00
Michael Minella
8b22a6e98d Ignoring tests that I had unignored 2014-09-24 09:34:10 -05:00