title: Spring Batch - The Job is not starting because ORA-14400: inserted partition key does not map to any partition
body: <p>I am getting this issue after placing System.exit(0) in the run to stop the job after execution. </p>
  
  <p>I tried SpringApplication.run(BatchApplication.class, args).close() also top stop the job but it dint help because the job is internally using connecting to some redis server and the job wont close until the connection is not stopped. So, I took the path of System.exit(0).</p>
  
  <p>After that everytime I am starting the job, its giving me this error and I have no idea how to resolve it in spring boot. I tried using HSQLDB also , but it seems like spring-jdbc internally used Hikari datasource. </p>
  
  <p>Thanks in advance for any help. </p>
  
  <p>I tried to create initialization script also : </p>
  
  <pre><code>DROP TABLE BATCH_JOB_INSTANCE;
  CREATE TABLE BATCH_JOB_INSTANCE(
  JOB_INSTANCE_ID NUMBER(10,0) NOT NULL AUTO_INCREMENT,
  JOB_NAME VARCHAR2(255) DEFAULT NULL,
  JOB_KEY VARCHAR2(255) DEFAULT NULL,
  VERSION NUMBER(19,2) DEFAULT NULL,
  PRIMARY KEY (ID));
  </code></pre>
  
  <p>Here are the configuration in application.yml :</p>
  
  <pre><code>spring.datasource.url=jdbc:h2:mem:testdb
  spring.datasource.driverClassName=org.h2.Driver
  spring.datasource.username=sa
  spring.datasource.password=
  spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
  </code></pre>
  
  <p>The exception I am getting :</p>
  
  <pre><code>uncategorized SQLException for SQL [INSERT into BATCH_JOB_INSTANCE(JOB_INSTANCE_ID, JOB_NAME, JOB_KEY, VERSION) values (?, ?, ?, ?)]; SQL state [72000]; error code [14400]; ORA-14400: inserted partition key does not map to any partition; nested exception is java.sql.SQLException: ORA-14400: inserted partition key does not map to any partition
  
  at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:89) ~[spring-jdbc-5.0.5.RELEASE.jar!/:5.0.5.RELEASE]
  at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81) ~[spring-jdbc-5.0.5.RELEASE.jar!/:5.0.5.RELEASE]
  at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81) ~[spring-jdbc-5.0.5.RELEASE.jar!/:5.0.5.RELEASE]
  at org.springframework.jdbc.core.JdbcTemplate.translateException(JdbcTemplate.java:1402) ~[spring-jdbc-5.0.5.RELEASE.jar!/:5.0.5.RELEASE]
  at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:620) ~[spring-jdbc-5.0.5.RELEASE.jar!/:5.0.5.RELEASE]
  at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:850) ~[spring-jdbc-5.0.5.RELEASE.jar!/:5.0.5.RELEASE]
  at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:905) ~[spring-jdbc-5.0.5.RELEASE.jar!/:5.0.5.RELEASE]
  at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:910) ~[spring-jdbc-5.0.5.RELEASE.jar!/:5.0.5.RELEASE]
  at org.springframework.batch.core.repository.dao.JdbcJobInstanceDao.createJobInstance(JdbcJobInstanceDao.java:115) ~[spring-batch-core-4.0.1.RELEASE.jar!/:4.0.1.RELEASE]
  at org.springframework.batch.core.repository.support.SimpleJobRepository.createJobExecution(SimpleJobRepository.java:139) ~[spring-batch-core-4.0.1.RELEASE.jar!/:4.0.1.RELEASE]
  at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
  at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
  at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
  at java.base/java.lang.reflect.Method.invoke(Method.java:564) ~[na:na]
  at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344) ~[spring-aop-5.0.5.RELEASE.jar!/:5.0.5.RELEASE]
  at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:197) ~[spring-aop-5.0.5.RELEASE.jar!/:5.0.5.RELEASE]
  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.0.5.RELEASE.jar!/:5.0.5.RELEASE]
  at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:294) ~[spring-tx-5.0.5.RELEASE.jar!/:5.0.5.RELEASE]
  at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98) ~[spring-tx-5.0.5.RELEASE.jar!/:5.0.5.RELEASE]
  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185) ~[spring-aop-5.0.5.RELEASE.jar!/:5.0.5.RELEASE]
  at org.springframework.batch.core.repository.support.AbstractJobRepositoryFactoryBean$1.invoke(AbstractJobRepositoryFactoryBean.java:181) ~[spring-batch-core-4.0.1.RELEASE.jar!/:4.0.1.RELEASE]
  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185) ~[spring-aop-5.0.5.RELEASE.jar!/:5.0.5.RELEASE]
  at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212) ~[spring-aop-5.0.5.RELEASE.jar!/:5.0.5.RELEASE]
  at com.sun.proxy.$Proxy107.createJobExecution(Unknown Source) ~[na:na]
  at org.springframework.batch.core.launch.support.SimpleJobLauncher.run(SimpleJobLauncher.java:131) ~[spring-batch-core-4.0.1.RELEASE.jar!/:4.0.1.RELEASE]
  at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
  at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
  at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
  at java.base/java.lang.reflect.Method.invoke(Method.java:564) ~[na:na]
  at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344) ~[spring-aop-5.0.5.RELEASE.jar!/:5.0.5.RELEASE]
  at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:197) ~[spring-aop-5.0.5.RELEASE.jar!/:5.0.5.RELEASE]
  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.0.5.RELEASE.jar!/:5.0.5.RELE
  </code></pre>