Commit Graph

2274 Commits

Author SHA1 Message Date
Spring Builds
656e3f8895 [artifactory-release] Next development version 2022-11-24 03:30:11 +00:00
Spring Builds
3bef84da7c [artifactory-release] Release version 5.0.0 2022-11-24 03:30:08 +00:00
Mahmoud Ben Hassine
daaa0013b1 Fetch step executions in SimpleJobRepository#findJobExecutions
Resolves #4242
2022-11-23 17:23:44 +01:00
Mahmoud Ben Hassine
4a946892ed Revert adding a JobRegistryBPP in the default batch configuration
Related to #4245
2022-11-23 15:52:10 +01:00
Mahmoud Ben Hassine
15069aa1dc Fix typos 2022-11-23 15:52:10 +01:00
Danilo Piazzalunga
fc0ec01ff8 Throw IllegalStateException from afterPropertiesSet
Consistently use Assert.state in the afterPropertiesSet()
methods to throw IllegalStateException instead of
IllegalArgumentException when some properties are missing
and/or invalid.

Resolves #2244
2022-11-23 12:22:26 +01:00
Mahmoud Ben Hassine
66e0b9afde Register a JobOperator and a JobRegistryBPP with the default configuration
This commit registers a `SimpleJobOperator` with the default
batch configuration through `EnableBatchProcessing` and
`DefaultBatchConfiguration`.

It also registers a `JobRegistryBeanPostProcessor` to automatically
populate the registry with user defined jobs.

Resolves #3941
2022-11-23 10:26:17 +01:00
Mahmoud Ben Hassine
171a3c8508 Add method getJobInstance in JobOperator
Issue #3930
2022-11-23 08:31:30 +01:00
Mahmoud Ben Hassine
596ee705c8 Refine contribution #3932
* Add default methods in interfaces
* Update tests/Javadoc
* Optimize imports
* Apply code style formatting
2022-11-23 08:08:23 +01:00
Parikshit Dutta
5a35b03300 Add getJobInstance method in JobExplorer/JobRepository
Resolves #3930
2022-11-23 07:44:24 +01:00
Mahmoud Ben Hassine
fd7dd5f1a7 Change the default transaction isolation level to DEFAULT in AbstractJobExplorerFactoryBean
Resolves #4230
2022-11-23 07:13:37 +01:00
Mahmoud Ben Hassine
f14b9a10ef Add native serialization hints for basic Java types
Resolves #4239
2022-11-22 16:34:01 +01:00
Aleksandr Arshavskiy
dfbc3d03da Add serialization runtime hint for HashMap
Partially resolves #4239
2022-11-22 16:07:01 +01:00
Taeik Lim
5da3fce34c Change JobBuilderHelper#enhance parameter type to AbstractJob
Issue #4231
2022-11-22 11:29:38 +01:00
Taeik Lim
3385a19cb4 Change StepBuilderHelper#enhance parameter type to AbstractStep
Issue #4220
2022-11-22 11:27:24 +01:00
Henning Poettker
92238260f1 Fix JdbcJobExecutionDaoTests 2022-11-18 11:20:09 +01:00
Marvin Deng
1498f90158 Upgrade job execution status from STOPPING to STOPPED if it has already ended
Resolves #4064
2022-11-18 11:20:08 +01:00
Philippe Marschall
c0547c618b Remove sorting from JdbcJobExecutionDao#GET_RUNNING_EXECUTIONS
Remove the sorting from JdbcJobExecutionDao#GET_RUNNING_EXECUTIONS
because #findRunningJobExecutions returns an unsorted HashSet.

Resolves #3987
2022-11-17 16:17:56 +01:00
Marvin Deng
bbf35b79f7 Make the meaning of running status consistent
- A running status is STARTING, STARTED, or STOPPING.
- Update related tests.

 Resolves #1483
2022-11-17 15:40:29 +01:00
Mahmoud Ben Hassine
930bb0243c Implement default methods in SimpleJobRepository
Resolves #4229
2022-11-16 16:11:33 +01:00
Spring Builds
e273ec151e [artifactory-release] Next development version 2022-11-09 14:34:37 +00:00
Spring Builds
420a7baa75 [artifactory-release] Release version 5.0.0-RC2 2022-11-09 14:34:34 +00:00
Mahmoud Ben Hassine
0a048f31c3 Fix typo in exception message 2022-11-09 10:18:35 +01:00
Mahmoud Ben Hassine
2edd4006d2 Change the return type of counting methods in various DAOs from int to long
This is required for job repository/explorer implementations
that use the Long type to count records in the database.

Resolves #4227
2022-11-08 22:06:16 +01:00
Mahmoud Ben Hassine
621ec92586 Add Micrometer counter for job launches
Resolves #4226
2022-11-08 12:28:43 +01:00
Mahmoud Ben Hassine
d444a8abaf Make the MeterRegistry used by Micrometer configurable
Resolves #4224
2022-11-08 08:33:28 +01:00
Mahmoud Ben Hassine
d889f84735 Remove the static configuration of Micrometer's observation registry
Resolves #4222
2022-11-08 07:48:45 +01:00
Mahmoud Ben Hassine
051e0220fc Add native resource hint for MariaDB DDL script
Related to #3891
2022-11-04 13:24:47 +01:00
Mahmoud Ben Hassine
bc92c4a1da Add native reflection hints for Job/Step contexts 2022-11-04 11:21:37 +01:00
Mahmoud Ben Hassine
5da133ac36 Make ObservationRegistry non final in BatchMetrics
This makes it possible to assign a pre-configured
ObservationRegistry (by Spring Boot for instance)
in BatchMetrics
2022-10-25 17:43:32 +02:00
Mahmoud Ben Hassine
eda046414f Fix typo in method name in DefaultBatchConfiguration 2022-10-25 16:45:50 +02:00
Mahmoud Ben Hassine
524e9564c0 Add full support for MariaDB
This commit adds full support for MariaDB as
a job repository and removes the code that
treats it as MySQL.

Resolves #3891
Resolves #4217
2022-10-25 11:11:57 +02:00
Spring Builds
24283a8a1f [artifactory-release] Next development version 2022-10-19 23:57:21 +00:00
Spring Builds
adde7d764e [artifactory-release] Release version 5.0.0-RC1 2022-10-19 23:57:18 +00:00
Henning Poettker
15ef22284a Update MySQL Connector/J and use new Maven coordinates 2022-10-19 17:16:20 +02:00
Mahmoud Ben Hassine
0b694117eb Add Spring Batch version in the execution context
Resolves #4215
2022-10-19 16:48:08 +02:00
Mahmoud Ben Hassine
de567e8c6f Fix JavaBean setter collision
This commit changes the name of the overloaded
setter for isolationLevelForCreate to remove
ambiguity in setter selection by Spring Framework.

Resolves #4213
2022-10-18 11:46:02 +02:00
Mahmoud Ben Hassine
05f6d136c6 Fix link to spring-batch.xsd in spring.schemas 2022-10-18 11:18:09 +02:00
Spring Builds
58c760b3ef [artifactory-release] Next development version 2022-10-13 10:34:01 +00:00
Spring Builds
87f3644667 [artifactory-release] Release version 5.0.0-M8 2022-10-13 10:33:58 +00:00
Mahmoud Ben Hassine
1ff04d532d Deprecate throttle limit in TaskExecutorRepeatTemplate
Resolves #2218
2022-10-12 18:57:18 +02:00
Mahmoud Ben Hassine
f185fd1598 Deprecate JobRegistryBackgroundJobRunner 2022-10-12 18:49:31 +02:00
Mahmoud Ben Hassine
26c39cbbae Refine contribution #3967
Related to #752
2022-10-12 17:23:58 +02:00
Philippe Truche
746c919372 Support command as array of strings
setCommand now supports passing in an array of strings. When a single
string is supplied, it is tokenized by the Runtime#exec method. When an
array of strings is supplied, the array is supplied as is to the
Runtime#exec method in which case no tokenization takes place.

Resolves #752
2022-10-12 16:36:30 +02:00
Mahmoud Ben Hassine
4eefb1d287 Refine contribution #3972
Related to #3955
2022-10-12 15:37:45 +02:00
Stefano Cordio
eccea800fb Add CommandRunner and JvmCommandRunner in SystemCommandTasklet
This improves the testability of `SystemCommandTasklet` when the
target command is not available during test execution.

Resolves #3955
2022-10-12 14:56:07 +02:00
Mahmoud Ben Hassine
6fbbeb8e5b Fix timestamp precision in schema-derby.sql
Related to 81728c00ed
2022-10-12 08:38:27 +02:00
Mahmoud Ben Hassine
d66372a0fb Fix timestamp precision in schema-hsqldb-extended.sql
Related to 81728c00ed
2022-10-12 08:06:13 +02:00
Mahmoud Ben Hassine
81728c00ed Increase the value of fractional seconds precision in timestamp columns
This commit increases the value of fractional seconds precision to 9
for database providers that support a value higher than 6 (which is the
default value for most database providers).

The reason for this change is that a `java.time.LocalDateTime` has a
FSP of 9, and a round trip to the database as a `java.sql.Timestamp`
results in data loss at the FSP level.

Here is an example in JdbcStepExecutionDaoTests#testSaveAndGetExecution:

```
assertStepExecutionsAreEqual:318
   expected: <2022-10-12T03:42:01.305896170>
   but was:  <2022-10-12T03:42:01.305896>
```

Some DB providers like MySQL [1], Postgresql [2], SAP HANA [3],
SQLServer [4] and SyBase [5] do not support FSP up to 9.

[1]: https://dev.mysql.com/doc/refman/8.0/en/datetime.html
[2]: https://www.postgresql.org/docs/current/datatype-datetime.html
[3]: https://help.sap.com/docs/SAP_HANA_PLATFORM/4fe29514fd584807ac9f2a04f6754767/3f81ccc7e35d44cbbc595c7d552c202a.html?version=2.0.02&locale=en-US
[4]: https://learn.microsoft.com/en-us/sql/t-sql/data-types/datetime-transact-sql?view=sql-server-ver16
[5]: https://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc38151.1510/html/iqrefbb/iqrefbb587.htm
2022-10-12 07:14:05 +02:00
Mahmoud Ben Hassine
5c92623785 Fix Timestamp to LocalDateTime conversion in Job/Step execution DAOs
Persisting a LocalDateTime as a Timestamp with `Timestamp.valueOf(LocalDateTime)`
and retrieving it with `ResultSet#getObject(index, LocalDateTime.class)` seems
to result in a data loss at the millisecond fraction level.

This commit changes the usage of `ResultSet#getObject(index, LocalDateTime.class)`
to `ResultSet#getTimestamp(index).toLocalDateTime()`.

A round trip to the database with `Timestamp.valueOf(LocalDateTime)` and
`Timestamp.toLocalDateTime()` should not result in a data loss.
2022-10-12 06:46:05 +02:00