Commit Graph

1744 Commits

Author SHA1 Message Date
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
Michael Minella
5b056e8126 Handle scenario where scanned item is filtered out
BATCH-2302 documents a scenario where an item throws an exception in a
fault tollerant step in the write, then in the process, throws an
exception as well.  This leads to an infinite loop.  To address this,
prior to attempting to write items during scanning we need to validate
that the there are items to be written (we were not which was causing a
NoSuchElementException when we did inputs.next().

This commit also removes an eronous System.out left in the
CoreNamespaceUtils.
2014-09-23 14:12:48 -05:00
Michael Minella
aee9dc2f6f Update stopped flag to volitile in SystemCommandTasklet
The SystemCommandTasklet checks a flag to determine if another thread
has requested that it be stopped.  Since this flag will be set via
another thread than the executing thread, it needs to be declared
volitile so that it's state is propigated across threads correctly.  The
documentation for StoppableTasklet has also been upadted to call out
that scenario.

This commit addresses Jira BATCH-2271
2014-09-22 15:39:17 -05:00
Michael Minella
19af4133eb Update DefaultBatchConfigurer to conform to @PostConstruct contracts
Prior to this commit the initialize method (which is annotated with
@PostConstruct) was throwing a checked exception wich goes against the
@PostConstruct contract.  We now wrap any checked exceptions in a
BatchConfigurationException and throw that.

This commit fixes (again) BATCH-2276
2014-09-22 14:19:59 -05:00
Michael Minella
a2f2df0b17 Conditionally add custom scopes when using XML configuration
When using a combination of Java configuration and the XML namespace
configuration, prior to this commit, we would add the batch custom
scopes twice which lead to issues.  This commit gives priority to the
custom scopes provided by the java configuration.  If you've used
@EnableBatchProcessing and have configured batch components using the
batch namespace, the custom scopes that come with the java config will
take precidence.

This commit addresses Jira BATCH-2266
2014-09-22 13:48:28 -05:00
Michael Minella
04b339b8f4 Add BeanCreationException to list of standard failure exceptions
Without this change, when passing an invalid job parameter to a bean
that is created internally by Spring Batch will cause a
BeanCreationException that is essentially ignored.  Due to it being
ignored, an infinite loop occurs in processing.
2014-09-16 11:01:30 -05:00
Chris Schaefer
47eba434d8 BATCH-1863: The batch namespace can not be used with allowBeanDefinitionOverriding=false 2014-09-15 15:05:26 -05:00