Search code examples
spring-batchversionmetatable

What's the VERSION column in BATCH_JOB_INSTANCE of Spring batch meta tables?


I implemented some codes with spring batch. After my batch worked, data have been stored in metadata tables.

I figured out that BATCH_JOB_INSTANCE and BATCH_JOB_EXECUTION have VERSION column and their version columns differ.

Could you tell me what version mean?


Solution

  • Spring Batch employs an optimistic locking strategy when dealing with database updates, and this is where the version column comes to play. This is explained in details in the Appendix A: Meta-Data Schema.