0

I used this schema to create Spring batch tables in MariaDB - https://github.com/spring-projects/spring-batch/blob/master/spring-batch-core/src/main/resources/org/springframework/batch/core/schema-mysql.sql.

BATCH_JOB_EXECUTION_PARAMS table fails with below error

Error: (conn=10719030) This table type requires a primary key
SQLState:  42000
ErrorCode: 1173

2 Answers 2

1

Add PRIMARY KEY(JOB_EXECUTION_ID, KEY_NAME) to BATCH_JOB_EXECUTION_PARAMS if that combination is Unique.

BATCH_JOB_EXECUTION_SEQ also has no PK. The UNIQUE key could be promoted to be the PK. (Ditto for some other tables.) That particular table is rather weird -- it turns a 1-byte UNIQUE_KEY into an 8-byte id!?!

BATCH_JOB_EXECUTION_PARAMS is a pretty awful variant of the classic EAV schema.

Sign up to request clarification or add additional context in comments.

Comments

1

MySQL and MariaDB are different products and it looks like they behave differently in regards to primary keys. You are using the MySQL DDL script against a MariaDB server which is not officially supported by Spring Batch.

So either adapt the script accordingly (by adding the primary keys manually) and be aware that Spring Batch would not necessarily work as expected since it does not support MariaDB officially, or open a feature request in the JIRA of the project to request support for MariaDB.

1 Comment

... Spring Batch would not necessarily work as expected since it does not support MariaDB officially ... I know it is an old post but want to check if it is still the case as I can't find much information about supported DB engines by Spring Batch.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.