Class SQLServerPersistenceManager
- java.lang.Object
-
- fish.payara.jbatch.persistence.rdbms.JBatchJDBCPersistenceManager
-
- fish.payara.jbatch.persistence.rdbms.SQLServerPersistenceManager
-
- All Implemented Interfaces:
com.ibm.jbatch.container.services.IPersistenceManagerService,com.ibm.jbatch.spi.services.IBatchServiceBase,JDBCQueryConstants,OracleJDBCConstants,SQLServerJDBCConstants
public class SQLServerPersistenceManager extends JBatchJDBCPersistenceManager implements SQLServerJDBCConstants
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,String>schemaTableNamesprotected Map<String,String>SQLServerCreateStrings-
Fields inherited from class fish.payara.jbatch.persistence.rdbms.JBatchJDBCPersistenceManager
createH2Strings, dataSource, jndiName, prefix, queryStrings, requestTracing, schema, suffix, tableNames
-
Fields inherited from interface fish.payara.jbatch.persistence.rdbms.JDBCQueryConstants
APPTAG, CHECKPOINT_TABLE_KEY, CREATE_JOB_EXECUTION_ENTRY, CREATE_JOB_INSTANCE, CREATE_JOBSTATUS, CREATE_STEP_EXECUTION, CREATE_STEP_STATUS, CREATE_SUB_JOB_INSTANCE, DELETE_JOB_EXECUTIONS, DELETE_JOBS, DELETE_STEP_EXECUTIONS, EXECUTION_INSTANCE_TABLE_KEY, GET_JOB_STATUS, GET_JOB_STATUS_FROM_EXECUTIONS, GET_MOST_RECENT_EXECUTION_ID, GET_PARAMETERS, GET_STEP_STATUS, GET_TAGNAME, H2_CREATE_TABLE_CHECKPOINTDATA, H2_CREATE_TABLE_EXECUTIONINSTANCEDATA, H2_CREATE_TABLE_JOBINSTANCEDATA, H2_CREATE_TABLE_JOBSTATUS, H2_CREATE_TABLE_STEPINSTANCEDATA, H2_CREATE_TABLE_STEPSTATUS, INSERT_CHECKPOINTDATA, JOB_INSTANCE_ID_BY_EXECUTION_ID, JOB_INSTANCE_TABLE_KEY, JOB_OPERATOR_GET_EXTERNAL_JOB_INSTANCE_DATA, JOB_OPERATOR_GET_JOB_EXECUTION, JOB_OPERATOR_GET_JOB_EXECUTIONS, JOB_OPERATOR_GET_RUNNING_EXECUTIONS, JOB_OPERATOR_QUERY_JOB_EXECUTION_BATCH_STATUS, JOB_OPERATOR_QUERY_JOB_EXECUTION_EXIT_STATUS, JOB_OPERATOR_QUERY_JOB_EXECUTION_JOB_ID, JOB_OPERATOR_QUERY_JOB_EXECUTION_TIMESTAMP, JOB_STATUS_TABLE_KEY, JOBOPERATOR_GET_JOB_INSTANCE_COUNT, JOBOPERATOR_GET_JOB_INSTANCE_IDS, LOCK_CHECKPOINTDATA, MARK_JOB_STARTED, MOST_RECENT_STEPS_FOR_JOB, Q_SET_SCHEMA, SELECT_CHECKPOINTDATA, SELECT_JOBINSTANCEDATA_APPTAG, SELECT_JOBINSTANCEDATA_COUNT, SELECT_JOBINSTANCEDATA_IDS, STEP_EXECUTION_INSTANCE_TABLE_KEY, STEP_EXECUTIONS_BY_STEP_ID, STEP_EXECUTIONS_FOR_JOB_EXECUTION, STEP_STATUS_TABLE_KEY, UPDATE_BATCH_STATUS_ONLY, UPDATE_CHECKPOINTDATA, UPDATE_FINAL_STATUS_AND_TIMESTAMP, UPDATE_JOBSTATUS, UPDATE_STEP_EXECUTION_WITH_METRICS, UPDATE_STEP_STATUS, UPDATE_WITH_FINAL_PARTITION_STEP_EXECUTION
-
Fields inherited from interface fish.payara.jbatch.persistence.rdbms.OracleJDBCConstants
CREATE_CHECKPOINTDATA_INDEX, CREATE_CHECKPOINTDATA_INDEX_KEY, CREATE_EXECUTIONINSTANCEDATA_SEQ, CREATE_EXECUTIONINSTANCEDATA_TRG, CREATE_JOBINSTANCEDATA_SEQ, CREATE_JOBINSTANCEDATA_TRG, CREATE_STEPINSTANCEDATA_SEQ, CREATE_STEPINSTANCEDATA_TRG, CREATE_TABLE_CHECKPOINTDATA, CREATE_TABLE_EXECUTIONINSTANCEDATA, CREATE_TABLE_JOBINSTANCEDATA, CREATE_TABLE_JOBSTATUS, CREATE_TABLE_STEPINSTANCEDATA, CREATE_TABLE_STEPSTATUS, DEFAULT_EXECUTIONINSTANCEDATA_TRG_KEY, DEFAULT_JOBINSTANCEDATA_TRG_KEY, DEFAULT_STEPINSTANCEDATA_TRG_KEY, EXECUTIONINSTANCEDATA_SEQ_KEY, EXECUTIONINSTANCEDATA_TRG_KEY, JOBINSTANCEDATA_SEQ_KEY, JOBINSTANCEDATA_TRG_KEY, STEPINSTANCEDATA_SEQ_KEY, STEPINSTANCEDATA_TRG_KEY
-
Fields inherited from interface fish.payara.jbatch.persistence.rdbms.SQLServerJDBCConstants
SQLSERVER_CREATE_TABLE_CHECKPOINTDATA, SQLSERVER_CREATE_TABLE_EXECUTIONINSTANCEDATA, SQLSERVER_CREATE_TABLE_JOBINSTANCEDATA, SQLSERVER_CREATE_TABLE_JOBSTATUS, SQLSERVER_CREATE_TABLE_STEPINSTANCEDATA, SQLSERVER_CREATE_TABLE_STEPSTATUS
-
-
Constructor Summary
Constructors Constructor Description SQLServerPersistenceManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancheckIfTableExists(DataSource dSource, String tableName, String schemaName)Note: H2 has a configuration setting DATABASE_TO_UPPER which is set to true per default.protected voidcreateSQLServerTableIfNotExist(String tableName, String createTableStatement)Create the jbatch tables if they do not exist.voidcreateTables(DataSource dataSource, BatchRuntimeConfiguration batchRuntimeConfiguration)protected Map<String,String>getSharedQueryMap(com.ibm.jbatch.spi.services.IBatchConfig batchConfig)Method invoked to insert the query strings used by all database types into a hashmapprotected Map<String,String>getSharedSchemaTableMap()protected Map<String,String>getSQLServerSharedQueryMap(com.ibm.jbatch.spi.services.IBatchConfig batchConfig)voidinit(com.ibm.jbatch.spi.services.IBatchConfig batchConfig)protected booleanisSchemaValid()Check the schema exists and if not we will use the default schemaprotected voidsetSchemaOnConnection(Connection connection)Set the schema to the default schema or the schema defined at batch configuration time-
Methods inherited from class fish.payara.jbatch.persistence.rdbms.JBatchJDBCPersistenceManager
checkTables, cleanupConnection, cleanupConnection, createCheckpointData, createFlowInSplitExecution, createJobExecution, createJobInstance, createJobStatus, createRuntimeJobExecutionEntry, createStepExecution, createStepExecution, createStepStatus, createSubJobInstance, createTableIfNotExists, deserializeObject, executeStatement, getCheckpointData, getConnection, getConnectionToDefaultSchema, getJobCurrentTag, getJobInstanceIdByExecutionId, getJobStatus, getJobStatusFromExecution, getMostRecentExecutionId, getMostRecentStepExecutionsForJobInstance, getParameters, getPartitionLevelJobInstanceWildCard, getSharedTableMap, getStepExecutionByStepExecutionId, getStepExecutionsForJobExecution, getStepStatus, getTableRowCount, getTagName, insertCheckpointData, jobOperatorGetExternalJobInstanceData, jobOperatorGetJobExecution, jobOperatorGetJobExecutions, jobOperatorGetJobInstanceCount, jobOperatorGetJobInstanceCount, jobOperatorGetJobInstanceIds, jobOperatorGetJobInstanceIds, jobOperatorGetRunningExecutions, jobOperatorQueryJobExecutionBatchStatus, jobOperatorQueryJobExecutionExitStatus, jobOperatorQueryJobExecutionJobInstanceId, jobOperatorQueryJobExecutionTimestamp, logException, markJobStarted, purge, queryCheckpointData, readJobExecutionRecord, serializeObject, setDefaultSchema, shutdown, updateBatchStatusOnly, updateCheckpointData, updateCheckpointData, updateJobStatus, updateStepExecution, updateStepExecutionWithMetrics, updateStepStatus, updateWithFinalExecutionStatusesAndTimestamps, updateWithFinalPartitionAggregateStepExecution
-
-
-
-
Method Detail
-
init
public void init(com.ibm.jbatch.spi.services.IBatchConfig batchConfig) throws com.ibm.jbatch.container.exception.BatchContainerServiceException- Specified by:
initin interfacecom.ibm.jbatch.spi.services.IBatchServiceBase- Overrides:
initin classJBatchJDBCPersistenceManager- Throws:
com.ibm.jbatch.container.exception.BatchContainerServiceException
-
isSchemaValid
protected boolean isSchemaValid() throws SQLExceptionCheck the schema exists and if not we will use the default schema- Overrides:
isSchemaValidin classJBatchJDBCPersistenceManager- Returns:
- Throws:
SQLException
-
createTables
public void createTables(DataSource dataSource, BatchRuntimeConfiguration batchRuntimeConfiguration)
- Overrides:
createTablesin classJBatchJDBCPersistenceManager
-
createSQLServerTableIfNotExist
protected void createSQLServerTableIfNotExist(String tableName, String createTableStatement) throws SQLException
Create the jbatch tables if they do not exist.- Parameters:
tableName-createTableStatement-- Throws:
SQLException
-
checkIfTableExists
public boolean checkIfTableExists(DataSource dSource, String tableName, String schemaName)
Description copied from class:JBatchJDBCPersistenceManagerNote: H2 has a configuration setting DATABASE_TO_UPPER which is set to true per default. So any table name is converted to upper case which is why you need to query for the table in upper case (or set DATABASE_TO_UPPER to false).- Overrides:
checkIfTableExistsin classJBatchJDBCPersistenceManager
-
setSchemaOnConnection
protected void setSchemaOnConnection(Connection connection)
Description copied from class:JBatchJDBCPersistenceManagerSet the schema to the default schema or the schema defined at batch configuration time- Overrides:
setSchemaOnConnectionin classJBatchJDBCPersistenceManager
-
getSharedQueryMap
protected Map<String,String> getSharedQueryMap(com.ibm.jbatch.spi.services.IBatchConfig batchConfig) throws SQLException
Description copied from class:JBatchJDBCPersistenceManagerMethod invoked to insert the query strings used by all database types into a hashmap- Overrides:
getSharedQueryMapin classJBatchJDBCPersistenceManager- Returns:
- Throws:
SQLException
-
getSQLServerSharedQueryMap
protected Map<String,String> getSQLServerSharedQueryMap(com.ibm.jbatch.spi.services.IBatchConfig batchConfig) throws SQLException
- Throws:
SQLException
-
-