org.springframework.dao.DataIntegrityViolationException

PreparedStatementCallback; SQL [UPDATE BATCH_STEP_EXECUTION_CONTEXT SET SHORT_CONTEXT = ?, SERIALIZED_CONTEXT = ? WHERE STEP_EXECUTION_ID = ?]; data exception: string data, right truncation; nested exception is java.sql.SQLDataException: data exception: string data, right truncation

Samebug tips0

There are no available Samebug tips for this exception. If you know how to solve this issue, help other users by writing a short tip.

Don't give up yet. Paste your full stack trace to get a solution.

Solutions on the web527

  • PreparedStatementCallback; SQL [UPDATE BATCH_STEP_EXECUTION_CONTEXT SET SHORT_CONTEXT = ?, SERIALIZED_CONTEXT = ? WHERE STEP_EXECUTION_ID = ?]; data exception: string data, right truncation; nested exception is java.sql.SQLDataException: data exception: string data, right truncation
  • PreparedStatementCallback; SQL [UPDATE BATCH_JOB_EXECUTION_CONTEXT SET SHORT_CONTEXT = ?, SERIALIZED_CONTEXT = ? WHERE JOB_EXECUTION_ID = ?]; data exception: string data, right truncation; nested exception is java.sql.SQLDataException: data
  • PreparedStatementCallback; SQL [UPDATE BATCH_JOB_EXECUTION_CONTEXT SET SHORT_CONTEXT = ?, SERIALIZED_CONTEXT = ? WHERE JOB_EXECUTION_ID = ?]; Data truncation: Data too long for column 'SERIALIZED_CONTEXT' at row 1; nested exception is com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'SERIALIZED_CONTEXT' at row 1
  • Stack trace

    • org.springframework.dao.DataIntegrityViolationException: PreparedStatementCallback; SQL [UPDATE BATCH_STEP_EXECUTION_CONTEXT SET SHORT_CONTEXT = ?, SERIALIZED_CONTEXT = ? WHERE STEP_EXECUTION_ID = ?]; data exception: string data, right truncation; nested exception is java.sql.SQLDataException: data exception: string data, right truncation at org.springframework.jdbc.support.SQLExceptionSubclassTranslator.doTranslate(SQLExceptionSubclassTranslator.java:82)[spring-jdbc-4.2.6.RELEASE.jar!/:4.2.6.RELEASE] at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:73)[spring-jdbc-4.2.6.RELEASE.jar!/:4.2.6.RELEASE] at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81)[spring-jdbc-4.2.6.RELEASE.jar!/:4.2.6.RELEASE] at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:645)[spring-jdbc-4.2.6.RELEASE.jar!/:4.2.6.RELEASE] at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:866)[spring-jdbc-4.2.6.RELEASE.jar!/:4.2.6.RELEASE] at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:927)[spring-jdbc-4.2.6.RELEASE.jar!/:4.2.6.RELEASE] at org.springframework.batch.core.repository.dao.JdbcExecutionContextDao.persistSerializedContext(JdbcExecutionContextDao.java:233)[spring-batch-core-3.0.7.RELEASE.jar!/:3.0.7.RELEASE] at org.springframework.batch.core.repository.dao.JdbcExecutionContextDao.updateExecutionContext(JdbcExecutionContextDao.java:161)[spring-batch-core-3.0.7.RELEASE.jar!/:3.0.7.RELEASE] at org.springframework.batch.core.repository.support.SimpleJobRepository.updateExecutionContext(SimpleJobRepository.java:205)[spring-batch-core-3.0.7.RELEASE.jar!/:3.0.7.RELEASE] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[na:1.8.0_77] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[na:1.8.0_77] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[na:1.8.0_77] at java.lang.reflect.Method.invoke(Method.java:498)[na:1.8.0_77] at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302)[spring-aop-4.2.6.RELEASE.jar!/:4.2.6.RELEASE] at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)[spring-aop-4.2.6.RELEASE.jar!/:4.2.6.RELEASE] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)[spring-aop-4.2.6.RELEASE.jar!/:4.2.6.RELEASE] at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)[spring-tx-4.2.6.RELEASE.jar!/:4.2.6.RELEASE] at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)[spring-tx-4.2.6.RELEASE.jar!/:4.2.6.RELEASE] at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)[spring-tx-4.2.6.RELEASE.jar!/:4.2.6.RELEASE] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)[spring-aop-4.2.6.RELEASE.jar!/:4.2.6.RELEASE] at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208)[spring-aop-4.2.6.RELEASE.jar!/:4.2.6.RELEASE] at com.sun.proxy.$Proxy79.updateExecutionContext(Unknown Source)[na:na] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[na:1.8.0_77] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[na:1.8.0_77] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[na:1.8.0_77] at java.lang.reflect.Method.invoke(Method.java:498)[na:1.8.0_77] at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302)[spring-aop-4.2.6.RELEASE.jar!/:4.2.6.RELEASE] at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)[spring-aop-4.2.6.RELEASE.jar!/:4.2.6.RELEASE] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)[spring-aop-4.2.6.RELEASE.jar!/:4.2.6.RELEASE] at org.springframework.batch.core.configuration.annotation.SimpleBatchConfiguration$PassthruAdvice.invoke(SimpleBatchConfiguration.java:127)[spring-batch-core-3.0.7.RELEASE.jar!/:3.0.7.RELEASE] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)[spring-aop-4.2.6.RELEASE.jar!/:4.2.6.RELEASE] at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208)[spring-aop-4.2.6.RELEASE.jar!/:4.2.6.RELEASE] at com.sun.proxy.$Proxy79.updateExecutionContext(Unknown Source)[na:na] at org.springframework.batch.core.step.tasklet.TaskletStep$ChunkTransactionCallback.doInTransaction(TaskletStep.java:451)[spring-batch-core-3.0.7.RELEASE.jar!/:3.0.7.RELEASE] at org.springframework.batch.core.step.tasklet.TaskletStep$ChunkTransactionCallback.doInTransaction(TaskletStep.java:330)[spring-batch-core-3.0.7.RELEASE.jar!/:3.0.7.RELEASE] at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133)[spring-tx-4.2.6.RELEASE.jar!/:4.2.6.RELEASE] at org.springframework.batch.core.step.tasklet.TaskletStep$2.doInChunkContext(TaskletStep.java:271)[spring-batch-core-3.0.7.RELEASE.jar!/:3.0.7.RELEASE] at org.springframework.batch.core.scope.context.StepContextRepeatCallback.doInIteration(StepContextRepeatCallback.java:81)[spring-batch-core-3.0.7.RELEASE.jar!/:3.0.7.RELEASE] at org.springframework.batch.repeat.support.RepeatTemplate.getNextResult(RepeatTemplate.java:374)[spring-batch-infrastructure-3.0.7.RELEASE.jar!/:3.0.7.RELEASE] at org.springframework.batch.repeat.support.RepeatTemplate.executeInternal(RepeatTemplate.java:215)[spring-batch-infrastructure-3.0.7.RELEASE.jar!/:3.0.7.RELEASE] at org.springframework.batch.repeat.support.RepeatTemplate.iterate(RepeatTemplate.java:144)[spring-batch-infrastructure-3.0.7.RELEASE.jar!/:3.0.7.RELEASE] at org.springframework.batch.core.step.tasklet.TaskletStep.doExecute(TaskletStep.java:257)[spring-batch-core-3.0.7.RELEASE.jar!/:3.0.7.RELEASE] at org.springframework.batch.core.step.AbstractStep.execute(AbstractStep.java:200)[spring-batch-core-3.0.7.RELEASE.jar!/:3.0.7.RELEASE] at org.springframework.batch.core.job.SimpleStepHandler.handleStep(SimpleStepHandler.java:148)[spring-batch-core-3.0.7.RELEASE.jar!/:3.0.7.RELEASE] at org.springframework.batch.core.job.AbstractJob.handleStep(AbstractJob.java:392)[spring-batch-core-3.0.7.RELEASE.jar!/:3.0.7.RELEASE] at org.springframework.batch.core.job.SimpleJob.doExecute(SimpleJob.java:135)[spring-batch-core-3.0.7.RELEASE.jar!/:3.0.7.RELEASE] at org.springframework.batch.core.job.AbstractJob.execute(AbstractJob.java:306)[spring-batch-core-3.0.7.RELEASE.jar!/:3.0.7.RELEASE] at org.springframework.batch.core.launch.support.SimpleJobLauncher$1.run(SimpleJobLauncher.java:135)[spring-batch-core-3.0.7.RELEASE.jar!/:3.0.7.RELEASE] at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:50)[spring-core-4.2.6.RELEASE.jar!/:4.2.6.RELEASE] at org.springframework.batch.core.launch.support.SimpleJobLauncher.run(SimpleJobLauncher.java:128)[spring-batch-core-3.0.7.RELEASE.jar!/:3.0.7.RELEASE] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[na:1.8.0_77] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[na:1.8.0_77] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[na:1.8.0_77] at java.lang.reflect.Method.invoke(Method.java:498)[na:1.8.0_77] at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302)[spring-aop-4.2.6.RELEASE.jar!/:4.2.6.RELEASE] at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)[spring-aop-4.2.6.RELEASE.jar!/:4.2.6.RELEASE] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)[spring-aop-4.2.6.RELEASE.jar!/:4.2.6.RELEASE] at org.springframework.batch.core.configuration.annotation.SimpleBatchConfiguration$PassthruAdvice.invoke(SimpleBatchConfiguration.java:127)[spring-batch-core-3.0.7.RELEASE.jar!/:3.0.7.RELEASE] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)[spring-aop-4.2.6.RELEASE.jar!/:4.2.6.RELEASE] at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208)[spring-aop-4.2.6.RELEASE.jar!/:4.2.6.RELEASE] at com.sun.proxy.$Proxy77.run(Unknown Source)[na:na] at uk.ac.fife.studentseeding.batch.BatchScheduler.runJob(BatchScheduler.java:117)[studentseeding-service-1.16.1.jar!/:na] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[na:1.8.0_77] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[na:1.8.0_77] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[na:1.8.0_77] at java.lang.reflect.Method.invoke(Method.java:498)[na:1.8.0_77] at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:65)[spring-context-4.2.6.RELEASE.jar!/:4.2.6.RELEASE] at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)[spring-context-4.2.6.RELEASE.jar!/:4.2.6.RELEASE] at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:81)[spring-context-4.2.6.RELEASE.jar!/:4.2.6.RELEASE] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[na:1.8.0_77] at java.util.concurrent.FutureTask.run(FutureTask.java:266)[na:1.8.0_77] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)[na:1.8.0_77] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)[na:1.8.0_77] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[na:1.8.0_77] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[na:1.8.0_77] at java.lang.Thread.run(Thread.java:745)[na:1.8.0_77] Caused by: java.sql.SQLDataException: data exception: string data, right truncation at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source)[hsqldb-2.3.3.jar!/:2.3.3] at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source)[hsqldb-2.3.3.jar!/:2.3.3] at org.hsqldb.jdbc.JDBCPreparedStatement.fetchResult(Unknown Source)[hsqldb-2.3.3.jar!/:2.3.3] at org.hsqldb.jdbc.JDBCPreparedStatement.executeUpdate(Unknown Source)[hsqldb-2.3.3.jar!/:2.3.3] at org.springframework.jdbc.core.JdbcTemplate$2.doInPreparedStatement(JdbcTemplate.java:873)[spring-jdbc-4.2.6.RELEASE.jar!/:4.2.6.RELEASE] at org.springframework.jdbc.core.JdbcTemplate$2.doInPreparedStatement(JdbcTemplate.java:866)[spring-jdbc-4.2.6.RELEASE.jar!/:4.2.6.RELEASE] at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:629)[spring-jdbc-4.2.6.RELEASE.jar!/:4.2.6.RELEASE] ... 72 more Caused by: org.hsqldb.HsqlException: data exception: string data, right truncation at org.hsqldb.error.Error.error(Unknown Source)[hsqldb-2.3.3.jar!/:2.3.3] at org.hsqldb.error.Error.error(Unknown Source)[hsqldb-2.3.3.jar!/:2.3.3] at org.hsqldb.types.CharacterType.castOrConvertToType(Unknown Source)[hsqldb-2.3.3.jar!/:2.3.3] at org.hsqldb.types.CharacterType.convertToType(Unknown Source)[hsqldb-2.3.3.jar!/:2.3.3] at org.hsqldb.StatementDML.getUpdatedData(Unknown Source)[hsqldb-2.3.3.jar!/:2.3.3] at org.hsqldb.StatementDML.executeUpdateStatement(Unknown Source)[hsqldb-2.3.3.jar!/:2.3.3] at org.hsqldb.StatementDML.getResult(Unknown Source)[hsqldb-2.3.3.jar!/:2.3.3] at org.hsqldb.StatementDMQL.execute(Unknown Source)[hsqldb-2.3.3.jar!/:2.3.3] at org.hsqldb.Session.executeCompiledStatement(Unknown Source)[hsqldb-2.3.3.jar!/:2.3.3] at org.hsqldb.Session.execute(Unknown Source)[hsqldb-2.3.3.jar!/:2.3.3] ... 77 more

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    Unknown user
    Once, 1 year ago
    Once, 3 weeks ago
    Unknown user
    Once, 1 month ago
    2 times, 1 month ago
    24 times, 2 months ago
    92 more bugmates