Class JdbcExecutionContextDao
java.lang.Object
org.springframework.batch.core.repository.dao.AbstractJdbcBatchMetadataDao
org.springframework.batch.core.repository.dao.JdbcExecutionContextDao
- All Implemented Interfaces:
ExecutionContextDao,org.springframework.beans.factory.InitializingBean
public class JdbcExecutionContextDao
extends AbstractJdbcBatchMetadataDao
implements ExecutionContextDao
JDBC DAO for
ExecutionContext.
Stores execution context data related to both Step and Job using a different table for each.
- Author:
- Lucas Ward, Robert Kasanicky, Thomas Risberg, Michael Minella, David Turanski, Mahmoud Ben Hassine
-
Field Summary
Fields inherited from class org.springframework.batch.core.repository.dao.AbstractJdbcBatchMetadataDao
DEFAULT_EXIT_MESSAGE_LENGTH, DEFAULT_SHORT_CONTEXT_LENGTH, DEFAULT_TABLE_PREFIX -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoiddeleteExecutionContext(JobExecution jobExecution) Delete the execution context of the givenJobExecution.voiddeleteExecutionContext(StepExecution stepExecution) Delete the execution context of the givenStepExecution.getExecutionContext(JobExecution jobExecution) getExecutionContext(StepExecution stepExecution) voidsaveExecutionContext(JobExecution jobExecution) Persist the execution context associated with the given jobExecution, persistent entry for the context should not exist yet.voidsaveExecutionContext(StepExecution stepExecution) Persist the execution context associated with the given stepExecution, persistent entry for the context should not exist yet.voidsaveExecutionContexts(Collection<StepExecution> stepExecutions) Persist the execution context associated with each stepExecution in a given collection, persistent entry for the context should not exist yet.voidsetCharset(Charset charset) Set theCharsetto use when serializing/deserializing the execution context.voidsetLobHandler(org.springframework.jdbc.support.lob.LobHandler lobHandler) Deprecated, for removal: This API element is subject to removal in a future version.Since 5.2 with no replacement.voidsetSerializer(ExecutionContextSerializer serializer) Setter forSerializerimplementationvoidsetShortContextLength(int shortContextLength) The maximum size that an execution context can have and still be stored completely in short form in the columnSHORT_CONTEXT.voidupdateExecutionContext(JobExecution jobExecution) Persist the updates of execution context associated with the given jobExecution.voidupdateExecutionContext(StepExecution stepExecution) Persist the updates of execution context associated with the given stepExecution.Methods inherited from class org.springframework.batch.core.repository.dao.AbstractJdbcBatchMetadataDao
getClobTypeToUse, getJdbcTemplate, getQuery, getTablePrefix, setClobTypeToUse, setJdbcTemplate, setTablePrefix
-
Constructor Details
-
JdbcExecutionContextDao
public JdbcExecutionContextDao()
-
-
Method Details
-
setSerializer
Setter forSerializerimplementation- Parameters:
serializer-ExecutionContextSerializerinstance to use.
-
setShortContextLength
public void setShortContextLength(int shortContextLength) The maximum size that an execution context can have and still be stored completely in short form in the columnSHORT_CONTEXT. Anything longer than this will overflow into large-object storage, and the first part only will be retained in the short form for readability. Default value is 2500. Clients using multi-bytes charsets on the database server may need to reduce this value to as little as half the value of the column size.- Parameters:
shortContextLength- int max length of the short context.
-
setCharset
Set theCharsetto use when serializing/deserializing the execution context. Must not benull. Defaults to "UTF-8".- Parameters:
charset- to use when serializing/deserializing the execution context.- Since:
- 5.0
-
getExecutionContext
- Specified by:
getExecutionContextin interfaceExecutionContextDao- Parameters:
jobExecution-JobExecutioninstance that contains the context.- Returns:
- execution context associated with the given jobExecution
-
getExecutionContext
- Specified by:
getExecutionContextin interfaceExecutionContextDao- Parameters:
stepExecution-StepExecutioninstance that contains the context.- Returns:
- execution context associated with the given stepExecution
-
updateExecutionContext
Description copied from interface:ExecutionContextDaoPersist the updates of execution context associated with the given jobExecution. Persistent entry should already exist for this context.- Specified by:
updateExecutionContextin interfaceExecutionContextDao- Parameters:
jobExecution-JobExecutioninstance that contains the context.
-
updateExecutionContext
Description copied from interface:ExecutionContextDaoPersist the updates of execution context associated with the given stepExecution. Persistent entry should already exist for this context.- Specified by:
updateExecutionContextin interfaceExecutionContextDao- Parameters:
stepExecution-StepExecutioninstance that contains the context.
-
saveExecutionContext
Description copied from interface:ExecutionContextDaoPersist the execution context associated with the given jobExecution, persistent entry for the context should not exist yet.- Specified by:
saveExecutionContextin interfaceExecutionContextDao- Parameters:
jobExecution-JobExecutioninstance that contains the context.
-
saveExecutionContext
Description copied from interface:ExecutionContextDaoPersist the execution context associated with the given stepExecution, persistent entry for the context should not exist yet.- Specified by:
saveExecutionContextin interfaceExecutionContextDao- Parameters:
stepExecution-StepExecutioninstance that contains the context.
-
saveExecutionContexts
Description copied from interface:ExecutionContextDaoPersist the execution context associated with each stepExecution in a given collection, persistent entry for the context should not exist yet.- Specified by:
saveExecutionContextsin interfaceExecutionContextDao- Parameters:
stepExecutions- a collection ofStepExecutions that contain the contexts.
-
deleteExecutionContext
Delete the execution context of the givenJobExecution.- Specified by:
deleteExecutionContextin interfaceExecutionContextDao- Parameters:
jobExecution-JobExecutionthat contains the context to delete.
-
deleteExecutionContext
Delete the execution context of the givenStepExecution.- Specified by:
deleteExecutionContextin interfaceExecutionContextDao- Parameters:
stepExecution-StepExecutionthat contains the context to delete.
-
setLobHandler
@Deprecated(since="5.2.0", forRemoval=true) public void setLobHandler(org.springframework.jdbc.support.lob.LobHandler lobHandler) Deprecated, for removal: This API element is subject to removal in a future version.Since 5.2 with no replacement. Scheduled for removal in v6- Parameters:
lobHandler- the lob handler to use
-
afterPropertiesSet
- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Overrides:
afterPropertiesSetin classAbstractJdbcBatchMetadataDao- Throws:
Exception
-