Skip to content

Use separate parameters for short_context length and exit_message length #1617

Closed
@spring-projects-issues

Description

@spring-projects-issues

Sebastien Lorber opened BATCH-1978 and commented

Hello,

In my usecase we have Java stacktraces as Exit Message.
These stacktraces are currently truncated because of the default 2500 limit.
This is a problem because the important part to the stack (caused by) is at the end and, oftenly, it's truncated.

In org.springframework.batch.core.repository.support.JobRepositoryFactoryBean#setMaxVarCharLength
It would be nice to have the possibility to specify a distinct value for short_context and exit_message.
Because it is not a problem if short_context is truncated for me, but it is for exit_message.

As I'm going to increase that limit, I also need to update the MySQL schema for short_context, to avoir problems with the varchar(2500):
ALTER TABLE BATCH_JOB_EXECUTION MODIFY EXIT_MESSAGE TEXT;
ALTER TABLE BATCH_STEP_EXECUTION MODIFY EXIT_MESSAGE TEXT;
ALTER TABLE BATCH_STEP_EXECUTION_CONTEXT MODIFY SHORT_CONTEXT TEXT;
ALTER TABLE BATCH_JOB_EXECUTION_CONTEXT MODIFY SHORT_CONTEXT TEXT;

By the way, it would be nice to be able to deactivate the truncation, in case the engine can truncate the exit_message itself. In MySQL, the TEXT type will handle the truncation, so I can safely put MAX_INT as a limit in setMaxVarCharLength


Affects: 2.1.9

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions