Skip to content

Best to distinguish CreateTime and StartTime in StepExecutionย #4049

Closed

Description

@lcmarvin

I need to record create time of StepExecution, but I found it only has a filed startTime, though this field has been assigned value when StepExecution is created.

private volatile Date startTime = new Date(System.currentTimeMillis());

But its value will be updated when StepExecution gets started in AbstractStep.

stepExecution.setStartTime(new Date());
stepExecution.setStatus(BatchStatus.STARTED);

So, maybe an individual createTime field is more suitable, just like what it is in JobExecution.

private volatile Date startTime = null;
private volatile Date createTime = new Date(System.currentTimeMillis());

Activity

  1. lcmarvin commented on Jan 26, 2022

    @lcmarvin
    ContributorAuthor

    This requires following changes at least:

    1. Schema updates, table bath_step_execution needs a new column create_time.
    2. Class StepExecution needs a new filed createTime.
    3. SQL in org.springframework.batch.core.repository.dao.JdbcStepExecutionDao#SAVE_STEP_EXECUTION, org.springframework.batch.core.repository.dao.JdbcStepExecutionDao#GET_RAW_STEP_EXECUTIONS, and org.springframework.batch.core.repository.dao.JdbcStepExecutionDao#GET_LAST_STEP_EXECUTION need to be updated to include create_time.
  2. assigned and unassigned on Feb 2, 2022
  3. lcmarvin commented on Feb 8, 2022

    @lcmarvin
    ContributorAuthor

    Please refer to PR #4057

  4. added this to the 5.0.0 milestone on Apr 8, 2022
  5. lcmarvin commented on Apr 16, 2022

    @lcmarvin
    ContributorAuthor

    Could you please link another pull request #4099 to this issue? Since a wrong rebase was done by mistake in #4057, so I close it.

    Sorry for that, Thanks๏ผ

  6. modified the milestones: 5.0.0, 5.0.0-M3 on Apr 27, 2022
  7. added a commit that references this issue on May 9, 2022
    0320fc8
  8. added a commit that references this issue on Feb 15, 2024
    464985b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions