Assert.state(getJobInstance(jobName, jobParameters) == null,
"JobInstance must not already exist");
Long jobId = jobIncrementer.nextLongValue();
JobInstance jobInstance = new JobInstance(jobId, jobName);
jobInstance.incrementVersion();
Object[] parameters = new Object[] { jobId, jobName,
jobKeyGenerator.generateKey(jobParameters), jobInstance.getVersion() };
getJdbcTemplate().update(
getQuery(CREATE_JOB_INSTANCE),
parameters,
new int[] { Types.BIGINT, Types.VARCHAR, Types.VARCHAR,
Types.INTEGER });